Class: Zyps::EatAction

Inherits:
DestroyAction show all
Defined in:
lib/zyps/actions.rb

Overview

Destroy the targets and grow in size.

Instance Attribute Summary

Attributes inherited from DestroyAction

#environment

Attributes inherited from Action

#started

Instance Method Summary collapse

Methods inherited from DestroyAction

#initialize

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