Class: Zyps::DestroyAction
Overview
Destroy the targets.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environment ⇒ Object
The environment to remove objects from.
Attributes inherited from Action
Instance Method Summary collapse
-
#do(actor, targets) ⇒ Object
Remove the target from the environment.
-
#initialize(environment) ⇒ DestroyAction
constructor
A new instance of DestroyAction.
Methods inherited from Action
#copy, #start, #started?, #stop
Constructor Details
#initialize(environment) ⇒ DestroyAction
Returns a new instance of DestroyAction.
133 134 135 |
# File 'lib/zyps/actions.rb', line 133 def initialize(environment) self.environment = environment end |
Instance Attribute Details
#environment ⇒ Object
The environment to remove objects from.
132 133 134 |
# File 'lib/zyps/actions.rb', line 132 def environment @environment end |
Instance Method Details
#do(actor, targets) ⇒ Object
Remove the target from the environment.
137 138 139 140 141 |
# File 'lib/zyps/actions.rb', line 137 def do(actor, targets) targets.each do |target| @environment.objects.delete(target) end end |