com.threerings.tudey.server.logic
Class EntryLogic

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.EntryLogic
Direct Known Subclasses:
EntryLogic.Camera, EntryLogic.StatefulProp

public class EntryLogic
extends Logic

A logic object associated with a scene entry.


Nested Class Summary
static class EntryLogic.Camera
          Special camera logic.
static class EntryLogic.StatefulProp
          Logic for stateful props.
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
protected  boolean _defaultEntrance
          Whether or not the entry represents a default entrance.
protected  EntityKey.Entry _entityKey
          The entity key.
protected  TudeySceneModel.Entry _entry
          The scene entry.
protected  HandlerLogic[] _handlers
          The entry's event handlers.
protected  Vector2f[] _patrolPath
          The entry's patrol path.
protected  float _rotation
          The entry's approximate rotation.
protected  Shape _shape
          The entry's shape.
protected  String[] _tags
          The entry's tags.
protected  Vector2f _translation
          The entry's approximate translation.
 
Fields inherited from class com.threerings.tudey.server.logic.Logic
_scenemgr, _variables
 
Constructor Summary
EntryLogic()
           
 
Method Summary
 void added()
          Notes that the entry has been added to the scene.
protected  void didInit()
          Override to perform custom initialization.
 EntityKey getEntityKey()
          Returns the entity key for this logic, if any.
 TudeySceneModel.Entry getEntry()
          Returns a reference to the scene entry corresponding to this logic.
 ConfigReference<ModelConfig> getModel()
          Returns a reference to the model associated with this logic, if any.
 Vector2f[] getPatrolPath()
          Returns a patrol path for this logic.
 float getRotation()
          Returns the rotation of this logic for the purpose of spawning actors, etc.
 Shape getShape()
          Returns a reference to this logic's shape, or returns null for none.
 String[] getTags()
          Returns the tags for this logic, if any.
 Vector2f getTranslation()
          Returns the translation of this logic for the purpose of spawning actors, etc.
 void init(TudeySceneManager scenemgr, TudeySceneModel.Entry entry)
          Initializes the logic.
 boolean isActive()
          Determines whether this logic object is still active in the scene.
 boolean isDefaultEntrance()
          Checks whether this logic object corresponds to a default entrance.
 void removed()
          Notes that the entry has been removed from the scene.
 void request(int timestamp, PawnLogic source, String name)
          Notifies the logic of a client request.
 void setVariable(int timestamp, Logic source, String name, Object value)
          Sets the value of a variable.
 void signal(int timestamp, Logic source, String name)
          Sends a generic "signal" to the logic.
 void transfer(Logic source, Map<Object,Object> refs)
          Transfers state from the specified source logic.
protected  void wasAdded()
          Override to perform custom startup.
protected  void wasRemoved()
          Override to perform custom cleanup.
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getSceneManager, getTransform, getTransform, getVariable, init, isVisible, removeShapeObserver, resolveTarget
 
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

_entityKey

protected EntityKey.Entry _entityKey
The entity key.


_entry

protected TudeySceneModel.Entry _entry
The scene entry.


_tags

protected String[] _tags
The entry's tags.


_defaultEntrance

protected boolean _defaultEntrance
Whether or not the entry represents a default entrance.


_translation

protected Vector2f _translation
The entry's approximate translation.


_rotation

protected float _rotation
The entry's approximate rotation.


_shape

protected Shape _shape
The entry's shape.


_patrolPath

protected Vector2f[] _patrolPath
The entry's patrol path.


_handlers

protected HandlerLogic[] _handlers
The entry's event handlers.

Constructor Detail

EntryLogic

public EntryLogic()
Method Detail

init

public void init(TudeySceneManager scenemgr,
                 TudeySceneModel.Entry entry)
Initializes the logic.


getEntry

public TudeySceneModel.Entry getEntry()
Returns a reference to the scene entry corresponding to this logic.


added

public void added()
Notes that the entry has been added to the scene.


removed

public void removed()
Notes that the entry has been removed from the scene.


getTags

public String[] getTags()
Description copied from class: Logic
Returns the tags for this logic, if any.

Overrides:
getTags in class Logic

isDefaultEntrance

public boolean isDefaultEntrance()
Description copied from class: Logic
Checks whether this logic object corresponds to a default entrance.

Overrides:
isDefaultEntrance in class Logic

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

getShape

public Shape getShape()
Description copied from class: Logic
Returns a reference to this logic's shape, or returns null for none.

Overrides:
getShape in class Logic

getPatrolPath

public Vector2f[] getPatrolPath()
Description copied from class: Logic
Returns a patrol path for this logic.

Overrides:
getPatrolPath in class Logic

getModel

public ConfigReference<ModelConfig> getModel()
Description copied from class: Logic
Returns a reference to the model associated with this logic, if any.

Overrides:
getModel in class Logic

signal

public void signal(int timestamp,
                   Logic source,
                   String name)
Description copied from class: Logic
Sends a generic "signal" to the logic.

Overrides:
signal in class Logic
Parameters:
timestamp - the signal timestamp.
source - the source of the signal.

setVariable

public void setVariable(int timestamp,
                        Logic source,
                        String name,
                        Object value)
Description copied from class: Logic
Sets the value of a variable.

Overrides:
setVariable in class Logic
Parameters:
timestamp - the set timestamp.
source - the source of the request.

request

public void request(int timestamp,
                    PawnLogic source,
                    String name)
Description copied from class: Logic
Notifies the logic of a client request.

Overrides:
request in class Logic
Parameters:
timestamp - the request timestamp.
source - the source of the request.

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.


wasAdded

protected void wasAdded()
Override to perform custom startup.


wasRemoved

protected void wasRemoved()
Override to perform custom cleanup.