Class: Zyps::EatAction
- Inherits:
-
DestroyAction
- Object
- Action
- DestroyAction
- Zyps::EatAction
- Defined in:
- lib/zyps/actions.rb
Overview
Destroy the targets and grow in size.
Instance Attribute Summary
Attributes inherited from DestroyAction
Instance Method Summary collapse
-
#do(actor, targets) ⇒ Object
Remove the targets from the environment, and increase actor’s size by size of targets.
Methods inherited from DestroyAction
Constructor Details
This class inherits a constructor from Zyps::DestroyAction
Instance Method Details
#do(actor, targets) ⇒ Object
Remove the targets from the environment, and increase actor’s size by size of targets.
151 152 153 154 155 156 157 158 |
# File 'lib/zyps/actions.rb', line 151 def do(actor, targets) #Grow in size. targets.each do |target| actor.size += target.size end #Remove the targets from the environment. super end |