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