com.threerings.tudey.server.logic
Class ActionLogic.Conditional

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.ActionLogic
              extended by com.threerings.tudey.server.logic.ActionLogic.Conditional
Enclosing class:
ActionLogic

public static class ActionLogic.Conditional
extends ActionLogic

Handles a conditional action.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.ActionLogic
ActionLogic.AbstractMove, ActionLogic.Compound, ActionLogic.Conditional, ActionLogic.Delayed, ActionLogic.DestroyActor, ActionLogic.ExpressionSwitch, ActionLogic.FireEffect, ActionLogic.ForceClientAction, ActionLogic.MoveAll, ActionLogic.MoveBody, ActionLogic.Random, ActionLogic.RotateActor, ActionLogic.SetFlag, ActionLogic.SetVariable, ActionLogic.Signal, ActionLogic.SpawnActor, ActionLogic.SpawnRandomTranslatedActor, ActionLogic.SpawnRotatedActor, ActionLogic.SpawnTransformedActor, ActionLogic.StepLimitMobile, ActionLogic.Switch, ActionLogic.Targeted, ActionLogic.TargetedAction, ActionLogic.WarpActor, ActionLogic.WarpTransformedActor
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
protected  ActionLogic _action
          The action to take if the condition is satisfied.
protected  ConditionLogic _condition
          The condition to evaluate.
protected  ActionLogic _elseAction
          The action to take if the condition is not satisfied.
 
Fields inherited from class com.threerings.tudey.server.logic.ActionLogic
_config, _source, _targets
 
Fields inherited from class com.threerings.tudey.server.logic.Logic
_scenemgr, _variables
 
Constructor Summary
ActionLogic.Conditional()
           
 
Method Summary
protected  void didInit()
          Override to perform custom initialization.
 boolean execute(int timestamp, Logic activator)
          Executes the action.
 boolean shouldExecute(Logic activator)
          Provides a hint as to whether this action should be executed.
 void transfer(Logic source, Map<Object,Object> refs)
          Transfers state from the specified source logic.
protected  void wasRemoved()
          Override to perform custom cleanup.
 
Methods inherited from class com.threerings.tudey.server.logic.ActionLogic
getEntityKey, getRotation, getTranslation, init, isActive, removed
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getModel, getPatrolPath, getSceneManager, getShape, getTags, getTransform, getTransform, getVariable, init, isDefaultEntrance, isVisible, removeShapeObserver, request, resolveTarget, setVariable, signal
 
Methods inherited from class com.threerings.util.ShallowObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_condition

protected ConditionLogic _condition
The condition to evaluate.


_action

protected ActionLogic _action
The action to take if the condition is satisfied.


_elseAction

protected ActionLogic _elseAction
The action to take if the condition is not satisfied.

Constructor Detail

ActionLogic.Conditional

public ActionLogic.Conditional()
Method Detail

shouldExecute

public boolean shouldExecute(Logic activator)
Description copied from class: ActionLogic
Provides a hint as to whether this action should be executed.

Overrides:
shouldExecute in class ActionLogic

execute

public boolean execute(int timestamp,
                       Logic activator)
Description copied from class: ActionLogic
Executes the action.

Specified by:
execute in class ActionLogic
activator - the entity that triggered the action.
Returns:
true of the action completed successfully

transfer

public void transfer(Logic source,
                     Map<Object,Object> refs)
Description copied from class: Logic
Transfers state from the specified source logic. Where relevant, this also takes the place of addition/startup notification.

Overrides:
transfer in class Logic

didInit

protected void didInit()
Description copied from class: ActionLogic
Override to perform custom initialization.

Overrides:
didInit in class ActionLogic

wasRemoved

protected void wasRemoved()
Description copied from class: ActionLogic
Override to perform custom cleanup.

Overrides:
wasRemoved in class ActionLogic