Class: MapReader::MapRoom
- Inherits:
-
Object
- Object
- MapReader::MapRoom
- Includes:
- MapUnquote
- Defined in:
- lib/IFMapper/MapReader.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#exits ⇒ Object
Returns the value of attribute exits.
-
#light ⇒ Object
Returns the value of attribute light.
-
#name ⇒ Object
Returns the value of attribute name.
-
#oneways ⇒ Object
Returns the value of attribute oneways.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize ⇒ MapRoom
constructor
def method_missing(*x) end.
- #inspect ⇒ Object
- #num_exits ⇒ Object
- #to_s ⇒ Object
Methods included from MapUnquote
Constructor Details
#initialize ⇒ MapRoom
def method_missing(*x)
end
162 163 164 165 166 167 168 |
# File 'lib/IFMapper/MapReader.rb', line 162 def initialize @tag = nil @desc = '' @oneways = 0 @light = true @exits = Array.new(12, nil) end |
Instance Attribute Details
#desc ⇒ Object
Returns the value of attribute desc.
135 136 137 |
# File 'lib/IFMapper/MapReader.rb', line 135 def desc @desc end |
#exits ⇒ Object
Returns the value of attribute exits.
135 136 137 |
# File 'lib/IFMapper/MapReader.rb', line 135 def exits @exits end |
#light ⇒ Object
Returns the value of attribute light.
135 136 137 |
# File 'lib/IFMapper/MapReader.rb', line 135 def light @light end |
#name ⇒ Object
Returns the value of attribute name.
134 135 136 |
# File 'lib/IFMapper/MapReader.rb', line 134 def name @name end |
#oneways ⇒ Object
Returns the value of attribute oneways.
136 137 138 |
# File 'lib/IFMapper/MapReader.rb', line 136 def oneways @oneways end |
#tag ⇒ Object
Returns the value of attribute tag.
135 136 137 |
# File 'lib/IFMapper/MapReader.rb', line 135 def tag @tag end |
Instance Method Details
#inspect ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/IFMapper/MapReader.rb', line 137 def inspect r = "#{to_s}\n" @exits.each_with_index { |e, idx| next if not e if idx > 7 dir = Connection::EXIT_TEXT[idx-7] else dir = Room::DIRECTIONS[idx] end r += "\t#{dir.upcase}: #{e}" } return r end |
#num_exits ⇒ Object
153 154 155 |
# File 'lib/IFMapper/MapReader.rb', line 153 def num_exits return @exits.nitems + @oneways end |
#to_s ⇒ Object
150 151 152 |
# File 'lib/IFMapper/MapReader.rb', line 150 def to_s "#@name tag:#@tag" end |