com.threerings.tudey.server.logic
Class BehaviorLogic

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.BehaviorLogic
Direct Known Subclasses:
BehaviorLogic.Combined, BehaviorLogic.Evaluating, BehaviorLogic.Idle, BehaviorLogic.Scripted

public abstract class BehaviorLogic
extends Logic

Handles the server-side processing for agent behavior.


Nested Class Summary
static class BehaviorLogic.Combined
          Handles the combined behavior.
static class BehaviorLogic.Evaluating
          Superclass of the evaluating behaviors.
static class BehaviorLogic.Follow
          Handles the follow behavior.
static class BehaviorLogic.Idle
          Handles the idle behavior.
static class BehaviorLogic.Pathing
          Base class for behaviors that involve following paths.
static class BehaviorLogic.Patrol
          Handles the patrol behavior.
static class BehaviorLogic.Random
          Handles the random behavior.
static class BehaviorLogic.Scripted
          Handles the scripted behavior.
static class BehaviorLogic.Wander
          Handles the wander behavior.
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
static float MAX_FOLLOW_PATH_LENGTH
          The maximum path length for following.
 
Constructor Summary
BehaviorLogic()
           
 
Method Summary
 Logic getCurrentTarget()
          Returns the currently targeted logic, if any.
 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, BehaviorConfig.Original config, AgentLogic agent)
          Initializes the logic.
 boolean isActive()
          Determines whether this logic object is still active in the scene.
 void penetratedEnvironment(Vector2f penetration)
          Notifies the behavior that the agent has penetrated its environment during advancement.
 void reachedTargetRotation()
          Notifies the behavior that the agent has reached its target rotation.
 void shutdown()
          Shuts down the behavior when the agent is destroyed.
 void startup()
          Starts up the behavior after initialization or suspension.
 void tick(int timestamp)
          Ticks the behavior.
 
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
 

Field Detail

MAX_FOLLOW_PATH_LENGTH

public static final float MAX_FOLLOW_PATH_LENGTH
The maximum path length for following.

See Also:
Constant Field Values
Constructor Detail

BehaviorLogic

public BehaviorLogic()
Method Detail

init

public void init(TudeySceneManager scenemgr,
                 BehaviorConfig.Original config,
                 AgentLogic agent)
Initializes the logic.


startup

public void startup()
Starts up the behavior after initialization or suspension.


shutdown

public void shutdown()
Shuts down the behavior when the agent is destroyed.


tick

public void tick(int timestamp)
Ticks the behavior.


reachedTargetRotation

public void reachedTargetRotation()
Notifies the behavior that the agent has reached its target rotation.


penetratedEnvironment

public void penetratedEnvironment(Vector2f penetration)
Notifies the behavior that the agent has penetrated its environment during advancement.

Parameters:
penetration - the sum penetration vector.

getCurrentTarget

public Logic getCurrentTarget()
Returns the currently targeted logic, if any.


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.