Class: MapReader::MapRoom

Inherits:
Object
  • Object
show all
Includes:
MapUnquote
Defined in:
lib/IFMapper/MapReader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MapUnquote

#unquote

Constructor Details

#initializeMapRoom

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

#descObject

Returns the value of attribute desc.



135
136
137
# File 'lib/IFMapper/MapReader.rb', line 135

def desc
  @desc
end

#exitsObject

Returns the value of attribute exits.



135
136
137
# File 'lib/IFMapper/MapReader.rb', line 135

def exits
  @exits
end

#lightObject

Returns the value of attribute light.



135
136
137
# File 'lib/IFMapper/MapReader.rb', line 135

def light
  @light
end

#nameObject

Returns the value of attribute name.



134
135
136
# File 'lib/IFMapper/MapReader.rb', line 134

def name
  @name
end

#onewaysObject

Returns the value of attribute oneways.



136
137
138
# File 'lib/IFMapper/MapReader.rb', line 136

def oneways
  @oneways
end

#tagObject

Returns the value of attribute tag.



135
136
137
# File 'lib/IFMapper/MapReader.rb', line 135

def tag
  @tag
end

Instance Method Details

#inspectObject



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_exitsObject



153
154
155
# File 'lib/IFMapper/MapReader.rb', line 153

def num_exits
  return @exits.nitems + @oneways
end

#to_sObject



150
151
152
# File 'lib/IFMapper/MapReader.rb', line 150

def to_s
  "#@name tag:#@tag"
end