sema
Class Element.ElementEvent

java.lang.Object
  extended bysema.Event
      extended bysema.Element.ElementEvent
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
AgentTestGrowing.FirstEvent, AgentTestSeeing.FirstEvent
Enclosing class:
Element

protected abstract class Element.ElementEvent
extends Event

Mother class for the event of an element. It encapsulates an automatic verification of the death before executing the action, and uses only a delay to register itself (relative time rather than absolute date).

See Also:
Event

Field Summary
 
Fields inherited from class sema.Event
date
 
Constructor Summary
Element.ElementEvent(double relativeDate)
          Constructs an event registered at the engine associated to the world of the element.
 
Method Summary
 boolean execute()
          The code of the event.
protected  void whatToDo()
          The action to override in order to execute something.
 
Methods inherited from class sema.Event
compareTo, delete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Element.ElementEvent

public Element.ElementEvent(double relativeDate)
Constructs an event registered at the engine associated to the world of the element.

Parameters:
relativeDate - the date of the event relative to the date of the register.
Method Detail

execute

public boolean execute()
The code of the event.

Overrides:
execute in class Event
Returns:
whether it executed.

whatToDo

protected void whatToDo()
Description copied from class: Event
The action to override in order to execute something.

Specified by:
whatToDo in class Event