Class: Worlds::Area
- Inherits:
-
Object
- Object
- Worlds::Area
- Defined in:
- lib/worlds/area.rb
Instance Attribute Summary collapse
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
-
#linked_areas ⇒ Object
readonly
Returns the value of attribute linked_areas.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Area
constructor
A new instance of Area.
- #to_s ⇒ Object
- #update(ms) ⇒ Object
Constructor Details
#initialize(name) ⇒ Area
Returns a new instance of Area.
5 6 7 8 9 |
# File 'lib/worlds/area.rb', line 5 def initialize(name) @name = name @entities = [] @linked_areas = [] end |
Instance Attribute Details
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
3 4 5 |
# File 'lib/worlds/area.rb', line 3 def entities @entities end |
#linked_areas ⇒ Object (readonly)
Returns the value of attribute linked_areas.
3 4 5 |
# File 'lib/worlds/area.rb', line 3 def linked_areas @linked_areas end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/worlds/area.rb', line 3 def name @name end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/worlds/area.rb', line 17 def to_s name end |
#update(ms) ⇒ Object
11 12 13 14 15 |
# File 'lib/worlds/area.rb', line 11 def update(ms) entities.flat_map { |entity| entity.update(ms) } end |