lib/IFMapper/Room.rb in ifmapper-1.0.7 vs lib/IFMapper/Room.rb in ifmapper-1.0.8
- old
+ new
@@ -8,10 +8,11 @@
attr_accessor :tasks # Tasks that need to be performed in room
attr_reader :exits # An array of 8 possible exits in room
attr_accessor :darkness # Isxxxxxxxxxx room in darkness?
attr_accessor :x, :y # Room location in grid
attr_accessor :desc # Room description
+ attr_accessor :comment # Room comment
DIR_TO_VECTOR = {
0 => [ 0, -1 ],
1 => [ 1, -1 ],
2 => [ 1, 0 ],
@@ -29,19 +30,23 @@
@exits = vars.shift
@darkness = vars.shift
@x = vars.shift
@y = vars.shift
@desc = nil
+ @comment = nil
if not vars.empty? and vars[0].kind_of?(String)
@desc = vars.shift
@desc.gsub!(/(\w)\s*\n/, '\1 ')
@desc.sub!(/\n+$/, '')
@desc.strip!
end
+ if not vars.empty? and vars[0].kind_of?(String)
+ @comment = vars.shift
+ end
end
def marshal_dump
- [ @name, @objects, @tasks, @exits, @darkness, @x, @y, @desc ]
+ [ @name, @objects, @tasks, @exits, @darkness, @x, @y, @desc, @comment ]
end
def [](dir)
return @exits[dir]
end