com.threerings.tudey.util
Class ActorAdvancer

java.lang.Object
  extended by com.threerings.tudey.util.ActorAdvancer
Direct Known Subclasses:
MobileAdvancer

public class ActorAdvancer
extends Object

Used on the client and the server to advance the state of an actor based on its state and surroundings.


Nested Class Summary
static interface ActorAdvancer.Environment
          Provides a callback mechanism to allow the advancer to query the actor's environment while advancing it.
 
Constructor Summary
ActorAdvancer(ActorAdvancer.Environment environment, Actor actor, int timestamp)
          Creates a new advancer for the supplied actor.
 
Method Summary
 void advance(int timestamp)
          Advances the actor to the specified timestamp.
 Actor getActor()
          Returns a reference to the advancer actor.
 int getTimestamp()
          Returns the advancer timestamp.
 void init(Actor actor, int timestamp)
          (Re)initializes the advancer.
 void jump(int timestamp)
          Jumps to the specified timestamp without actually taking a step.
 void transfer(ActorAdvancer source)
          Transfers state from the specified source advancer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActorAdvancer

public ActorAdvancer(ActorAdvancer.Environment environment,
                     Actor actor,
                     int timestamp)
Creates a new advancer for the supplied actor.

Method Detail

getActor

public Actor getActor()
Returns a reference to the advancer actor.


getTimestamp

public int getTimestamp()
Returns the advancer timestamp.


init

public void init(Actor actor,
                 int timestamp)
(Re)initializes the advancer.


transfer

public void transfer(ActorAdvancer source)
Transfers state from the specified source advancer.


advance

public void advance(int timestamp)
Advances the actor to the specified timestamp.


jump

public void jump(int timestamp)
Jumps to the specified timestamp without actually taking a step.



Copyright © 2011. All Rights Reserved.