com.threerings.tudey.server.logic
Class ConditionLogic

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.ConditionLogic
Direct Known Subclasses:
ConditionLogic.Action, ConditionLogic.All, ConditionLogic.Always, ConditionLogic.Any, ConditionLogic.Cooldown, ConditionLogic.DistanceWithin, ConditionLogic.Evaluate, ConditionLogic.Intersecting, ConditionLogic.Limit, ConditionLogic.Not, ConditionLogic.Random, ConditionLogic.Targeted

public abstract class ConditionLogic
extends Logic

Handles the evaluation of conditions.


Nested Class Summary
static class ConditionLogic.Action
          Evaluates the action condition.
static class ConditionLogic.All
          Evaluates the all condition.
static class ConditionLogic.Always
          Evaluates the always condition.
static class ConditionLogic.Any
          Evaluates the any condition.
static class ConditionLogic.Cooldown
          Evaluates the cooldown condition.
static class ConditionLogic.DistanceWithin
          Evaluates the distance within condition logic.
static class ConditionLogic.Evaluate
          Evaluates the evaluate condition.
static class ConditionLogic.FlagSet
          Evaluates the flag set condition.
static class ConditionLogic.InstanceOf
          Evaluates the instance of condition.
static class ConditionLogic.Intersecting
          Evaluates the intersect condition logic.
static class ConditionLogic.Limit
          Evaluates the limit condition.
static class ConditionLogic.Not
          Evaluates the not condition.
static class ConditionLogic.Random
          Evaluates the random condition.
static class ConditionLogic.Tagged
          Evaluates the tagged condition.
static class ConditionLogic.Targeted
          Simple base class for conditions with targets.
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Constructor Summary
ConditionLogic()
           
 
Method Summary
 EntityKey getEntityKey()
          Returns the entity key for this logic, if any.
 float getRotation()
          Returns the rotation of this logic for the purpose of spawning actors, etc.
 Vector2f getTranslation()
          Returns the translation of this logic for the purpose of spawning actors, etc.
 void init(TudeySceneManager scenemgr, ConditionConfig config, Logic source)
          Initializes the logic.
 boolean isActive()
          Determines whether this logic object is still active in the scene.
abstract  boolean isSatisfied(Logic activator)
          Determines whether the condition is satisfied.
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, getModel, getPatrolPath, getSceneManager, getShape, getTags, getTransform, getTransform, getVariable, init, isDefaultEntrance, isVisible, removeShapeObserver, request, resolveTarget, setVariable, signal, transfer
 
Methods inherited from class com.threerings.util.ShallowObject
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionLogic

public ConditionLogic()
Method Detail

init

public void init(TudeySceneManager scenemgr,
                 ConditionConfig config,
                 Logic source)
Initializes the logic.


isSatisfied

public abstract boolean isSatisfied(Logic activator)
Determines whether the condition is satisfied.

Parameters:
activator - the entity that triggered the action.

isActive

public boolean isActive()
Description copied from class: Logic
Determines whether this logic object is still active in the scene.

Overrides:
isActive in class Logic

getEntityKey

public EntityKey getEntityKey()
Description copied from class: Logic
Returns the entity key for this logic, if any.

Overrides:
getEntityKey in class Logic

getTranslation

public Vector2f getTranslation()
Description copied from class: Logic
Returns the translation of this logic for the purpose of spawning actors, etc.

Overrides:
getTranslation in class Logic

getRotation

public float getRotation()
Description copied from class: Logic
Returns the rotation of this logic for the purpose of spawning actors, etc.

Overrides:
getRotation in class Logic


Copyright © 2011. All Rights Reserved.