com.threerings.tudey.dobj
Class SceneDeltaEvent

java.lang.Object
  extended by com.threerings.presents.dobj.DEvent
      extended by com.threerings.tudey.dobj.SceneDeltaEvent
All Implemented Interfaces:
Streamable

public class SceneDeltaEvent
extends DEvent

Represents an update to the dynamic state of the scene. Each delta represents difference between the current state and the last state (either the baseline state or the result of applying the last acknowledged delta). These events are published on the client object, rather than the scene object, because they are targeted at specific clients.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  int _acknowledge
          The timestamp of the latest input frame received by the server.
protected  Actor[] _addedActors
          The actors added to the scene since the referenced update (or null).
protected  Effect[] _effectsFired
          The effects fired since the last delta (or null).
protected  short _elapsed
          The amount of time elapsed since the previous tick.
protected  short _ping
          The estimated ping time.
protected  int _reference
          The timestamp of the update that serves as a basis of comparison for this delta (either the last delta known to be acknowledged by the client, or 0 for the baseline).
protected  int[] _removedActorIds
          The ids of the actors removed since the referenced update (or null).
protected  int _sceneOid
          The oid of the scene to which this event applies.
protected  int _timestamp
          The timestamp of the delta.
protected  ActorDelta[] _updatedActorDeltas
          The deltas of the actors updated since the referenced update (or null
 
Fields inherited from class com.threerings.presents.dobj.DEvent
_actualTransport, _soid, _toid, _transport, eventId, UNSET_OLD_ENTRY, UNSET_OLD_VALUE
 
Constructor Summary
SceneDeltaEvent(int targetOid, int sceneOid, int acknowledge, short ping, int reference, int timestamp, short elapsed, Actor[] addedActors, ActorDelta[] updatedActorDeltas, int[] removedActorIds, Effect[] effectsFired)
          Creates a new delta event.
 
Method Summary
 boolean applyToObject(DObject target)
           
 int getAcknowledge()
          Returns the timestamp of the last input frame received by the server.
 Actor[] getAddedActors()
          Returns a reference to the array of actors added to the scene since the last delta, or null for none.
 Effect[] getEffectsFired()
          Returns the array of effects fired since the last delta, or null for none.
 short getElapsed()
          Returns the time elapsed since the last tick.
 short getPing()
          Returns the ping time estimate.
 int getReference()
          Returns the timestamp of the update that serves as a basis of comparison for this delta (either the last delta known to be acknowledged by the client, or 0 for the baseline).
 int[] getRemovedActorIds()
          Returns a reference to the array of ids of actors removed from the scene since the last delta, or null for none.
 int getSceneOid()
          Returns the oid of the scene to which this delta applies.
 int getTimestamp()
          Returns the timestamp of the delta.
 ActorDelta[] getUpdatedActorDeltas()
          Returns a reference to the array of deltas for actors updated since the last delta, or null for none.
protected  void notifyListener(Object listener)
           
protected  void toString(StringBuilder buf)
           
 
Methods inherited from class com.threerings.presents.dobj.DEvent
alreadyApplied, getActualTransport, getSourceOid, getTargetOid, getTransport, isPrivate, noteActualTransport, readField__toid, setSourceOid, setTargetOid, setTransport, toString, writeField__toid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_sceneOid

protected int _sceneOid
The oid of the scene to which this event applies.


_acknowledge

protected int _acknowledge
The timestamp of the latest input frame received by the server.


_ping

protected short _ping
The estimated ping time.


_reference

protected int _reference
The timestamp of the update that serves as a basis of comparison for this delta (either the last delta known to be acknowledged by the client, or 0 for the baseline).


_timestamp

protected int _timestamp
The timestamp of the delta.


_elapsed

protected short _elapsed
The amount of time elapsed since the previous tick.


_addedActors

protected Actor[] _addedActors
The actors added to the scene since the referenced update (or null).


_updatedActorDeltas

protected ActorDelta[] _updatedActorDeltas
The deltas of the actors updated since the referenced update (or null

_removedActorIds

protected int[] _removedActorIds
The ids of the actors removed since the referenced update (or null).


_effectsFired

protected Effect[] _effectsFired
The effects fired since the last delta (or null).

Constructor Detail

SceneDeltaEvent

public SceneDeltaEvent(int targetOid,
                       int sceneOid,
                       int acknowledge,
                       short ping,
                       int reference,
                       int timestamp,
                       short elapsed,
                       Actor[] addedActors,
                       ActorDelta[] updatedActorDeltas,
                       int[] removedActorIds,
                       Effect[] effectsFired)
Creates a new delta event.

Method Detail

getSceneOid

public int getSceneOid()
Returns the oid of the scene to which this delta applies.


getAcknowledge

public int getAcknowledge()
Returns the timestamp of the last input frame received by the server.


getPing

public short getPing()
Returns the ping time estimate.


getReference

public int getReference()
Returns the timestamp of the update that serves as a basis of comparison for this delta (either the last delta known to be acknowledged by the client, or 0 for the baseline).


getTimestamp

public int getTimestamp()
Returns the timestamp of the delta.


getElapsed

public short getElapsed()
Returns the time elapsed since the last tick.


getAddedActors

public Actor[] getAddedActors()
Returns a reference to the array of actors added to the scene since the last delta, or null for none.


getUpdatedActorDeltas

public ActorDelta[] getUpdatedActorDeltas()
Returns a reference to the array of deltas for actors updated since the last delta, or null for none.


getRemovedActorIds

public int[] getRemovedActorIds()
Returns a reference to the array of ids of actors removed from the scene since the last delta, or null for none.


getEffectsFired

public Effect[] getEffectsFired()
Returns the array of effects fired since the last delta, or null for none.


applyToObject

public boolean applyToObject(DObject target)
                      throws ObjectAccessException
Specified by:
applyToObject in class DEvent
Throws:
ObjectAccessException

notifyListener

protected void notifyListener(Object listener)
Overrides:
notifyListener in class DEvent

toString

protected void toString(StringBuilder buf)
Overrides:
toString in class DEvent