com.threerings.tudey.server.logic
Class ActivityLogic

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.ActivityLogic

public abstract class ActivityLogic
extends Logic

Logic classes for activities.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
protected  ActiveLogic _source
          The activity source.
protected  int _started
          The time at which the activity started.
 
Fields inherited from class com.threerings.tudey.server.logic.Logic
_scenemgr, _variables
 
Constructor Summary
ActivityLogic()
           
 
Method Summary
protected  void didInit()
          Override to perform custom initialization.
 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, ActiveLogic source)
          Initializes the logic.
 boolean isActive()
          Determines whether this logic object is still active in the scene.
protected  boolean shouldAdvance()
          Checks whether we should advance the activity to compensate for control latency, if relevant.
 void start(int timestamp)
          Starts the activity.
 void tick(int timestamp)
          Updates the activity.
 void transfer(Logic source, Map<Object,Object> refs)
          Transfers state from the specified source logic.
 
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

_source

protected ActiveLogic _source
The activity source.


_started

protected int _started
The time at which the activity started.

Constructor Detail

ActivityLogic

public ActivityLogic()
Method Detail

init

public void init(TudeySceneManager scenemgr,
                 ActiveLogic source)
Initializes the logic.


start

public void start(int timestamp)
Starts the activity.


tick

public void tick(int timestamp)
Updates the activity.


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

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()
Override to perform custom initialization.


shouldAdvance

protected boolean shouldAdvance()
Checks whether we should advance the activity to compensate for control latency, if relevant.