com.threerings.tudey.server.logic
Class ScriptLogic.Move

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

public static class ScriptLogic.Move
extends ScriptLogic

Handles a move script.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.ScriptLogic
ScriptLogic.Action, ScriptLogic.ClearSpeed, ScriptLogic.Condition, ScriptLogic.Goto, ScriptLogic.Move, ScriptLogic.Rotate, ScriptLogic.SetSpeed, ScriptLogic.Wait
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
protected  Logic _finalTarget
          The target location.
protected  Vector2f[] _path
          The path.
protected  int _pidx
          The index of the next point on the path.
protected  TargetLogic _target
          The move target.
 
Fields inherited from class com.threerings.tudey.server.logic.ScriptLogic
_agent, _config, _scripted, MAX_PATH_LENGTH
 
Fields inherited from class com.threerings.tudey.server.logic.Logic
_scenemgr, _variables
 
Constructor Summary
ScriptLogic.Move()
           
 
Method Summary
protected  void createPath()
          Create the movement path.
protected  void didInit()
          Override to perform custom initialization.
protected  boolean finishedMove()
          Checks if we've reached our target.
protected  void finishMove()
          Position ourselves exactly on our target.
protected  float getReachRadius()
          Returns the radius within which we can be consider ourselves to have reached a node (which depends on the actor's speed, since it's possible to overshoot).
 void start(int timestamp)
          Called when we are about to start the current script.
 void suspend()
          Called when we are suspending the current script.
 boolean tick(int timestamp)
          Ticks the script.
 void transfer(Logic source, Map<Object,Object> refs)
          Transfers state from the specified source logic.
 
Methods inherited from class com.threerings.tudey.server.logic.ScriptLogic
createScriptLogic, init, reachedTargetRotation, shutdown
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getEntityKey, getModel, getPatrolPath, getRotation, getSceneManager, getShape, getTags, getTransform, getTransform, getTranslation, getVariable, init, isActive, 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

_target

protected TargetLogic _target
The move target.


_path

protected Vector2f[] _path
The path.


_pidx

protected int _pidx
The index of the next point on the path.


_finalTarget

protected Logic _finalTarget
The target location.

Constructor Detail

ScriptLogic.Move

public ScriptLogic.Move()
Method Detail

start

public void start(int timestamp)
Description copied from class: ScriptLogic
Called when we are about to start the current script.

Overrides:
start in class ScriptLogic

tick

public boolean tick(int timestamp)
Description copied from class: ScriptLogic
Ticks the script.

Overrides:
tick in class ScriptLogic
Returns:
true if the script has completed

suspend

public void suspend()
Description copied from class: ScriptLogic
Called when we are suspending the current script.

Overrides:
suspend in class ScriptLogic

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

getReachRadius

protected float getReachRadius()
Returns the radius within which we can be consider ourselves to have reached a node (which depends on the actor's speed, since it's possible to overshoot).


createPath

protected void createPath()
Create the movement path.


finishedMove

protected boolean finishedMove()
Checks if we've reached our target.


finishMove

protected void finishMove()
Position ourselves exactly on our target.


didInit

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

Overrides:
didInit in class ScriptLogic