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
Attributes inherited from Action
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
Methods inherited from Action
#copy, #initialize, #start, #started?, #stop
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.
148 149 150 151 152 153 154 155 |
# File 'lib/zyps/actions.rb', line 148 def do(actor, targets) #Grow in size. targets.each do |target| actor.size += target.size end #Remove the targets from the environment. super end |