com.threerings.tudey.server.logic
Class PawnLogic
java.lang.Object
com.threerings.util.ShallowObject
com.threerings.tudey.server.logic.Logic
com.threerings.tudey.server.logic.ActorLogic
com.threerings.tudey.server.logic.MobileLogic
com.threerings.tudey.server.logic.ActiveLogic
com.threerings.tudey.server.logic.PawnLogic
- All Implemented Interfaces:
- HasActor, TudeySceneManager.TickParticipant, ActorAdvancer.Environment
public class PawnLogic
- extends ActiveLogic
Handles the state of a player-controlled actor.
| Fields inherited from class com.threerings.tudey.server.logic.ActorLogic |
_activator, _actor, _collisionFlagObservers, _collisionFlags, _config, _destroyed, _entityKey, _handlers, _previousSnapshot, _shape, _shapeDidChangeOp, _shapeObservers, _shapeWillChangeOp, _snapshot, _snapshotDelta, _snaptime, _source, MAX_ADJUSTMENT_DISTANCE, MAX_ADJUSTMENT_PATH_LENGTH |
|
Method Summary |
void |
bodyEntered(ClientLiaison client)
Notes that the controlling client has entered. |
protected ActorAdvancer |
createAdvancer()
Creates the advancer to use to update the actor. |
void |
enqueueInput(InputFrame frame)
Enqueues a single frame of input for processing. |
int |
getActivityAdvance()
Returns the amount of time to advance activities to compensate for control latency. |
int |
getControlDelta()
Computes and returns the difference between the time at which the controlling client depicts
this actor (its advanced time) and the time at which it depicts all other actors (its
delayed time). |
boolean |
tick(int timestamp)
Ticks the participant. |
| Methods inherited from class com.threerings.tudey.server.logic.MobileLogic |
collides, didInit, enteredStasis, getDirection, getPenetration, getSceneModel, getSnapshot, leftStasis, penetratedEnvironment, stepLimit, updateShape, wasDestroyed |
| Methods inherited from class com.threerings.tudey.server.logic.ActorLogic |
addCollisionFlagObserver, addShapeObserver, adjustSpawnPoint, adjustSpawnPoint, bodyWillEnter, bodyWillLeave, createActor, destroy, getActivator, getActor, getCollisionFlags, getEntityKey, getModel, getPreviousSnapshot, getRotation, getShape, getShapeElement, getSnapshotDelta, getSource, getTags, getTranslation, init, isActive, isDefaultEntrance, isDestroyed, isRemoved, isStatic, move, remove, removeCollisionFlagObserver, removeOnNextTick, removeShapeObserver, request, set, setActivator, setSource, setVariable, signal, testSpawnPoint, updateCollisionFlags, updateSnapshot, warp, warp, warp, wasRemoved, wasUpdated |
| Methods inherited from class com.threerings.tudey.server.logic.Logic |
createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getPatrolPath, getSceneManager, getTransform, getTransform, getVariable, init, isVisible, resolveTarget |
_advancer
protected PawnAdvancer _advancer
- A casted reference to the advancer.
_client
protected ClientLiaison _client
- The liaison for the controlling client.
_input
protected ArrayDeque<InputFrame> _input
- The list of pending input frames for the pawn.
PawnLogic
public PawnLogic()
bodyEntered
public void bodyEntered(ClientLiaison client)
- Notes that the controlling client has entered.
enqueueInput
public void enqueueInput(InputFrame frame)
- Enqueues a single frame of input for processing.
getControlDelta
public int getControlDelta()
- Computes and returns the difference between the time at which the controlling client depicts
this actor (its advanced time) and the time at which it depicts all other actors (its
delayed time).
getActivityAdvance
public int getActivityAdvance()
- Description copied from class:
ActiveLogic
- Returns the amount of time to advance activities to compensate for control latency.
- Overrides:
getActivityAdvance in class ActiveLogic
tick
public boolean tick(int timestamp)
- Description copied from interface:
TudeySceneManager.TickParticipant
- Ticks the participant.
- Specified by:
tick in interface TudeySceneManager.TickParticipant- Overrides:
tick in class ActiveLogic
- Parameters:
timestamp - the timestamp of the current tick.
- Returns:
- true to continue ticking the participant, false to remove it from the list.
createAdvancer
protected ActorAdvancer createAdvancer()
- Description copied from class:
MobileLogic
- Creates the advancer to use to update the actor.
- Overrides:
createAdvancer in class MobileLogic