Class: Worlds::Area

Inherits:
Object
  • Object
show all
Defined in:
lib/worlds/area.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#entitiesObject (readonly)

Returns the value of attribute entities.



3
4
5
# File 'lib/worlds/area.rb', line 3

def entities
  @entities
end

#linked_areasObject (readonly)

Returns the value of attribute linked_areas.



3
4
5
# File 'lib/worlds/area.rb', line 3

def linked_areas
  @linked_areas
end

#nameObject (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_sObject



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