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:
com.threerings.io.Streamable

public class SceneDeltaEvent
extends com.threerings.presents.dobj.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
com.threerings.io.Streamable.Closure
 
Field Summary
 
Fields inherited from class com.threerings.presents.dobj.DEvent
eventId
 
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(com.threerings.presents.dobj.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.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(com.threerings.presents.dobj.DObject target)
                      throws com.threerings.presents.dobj.ObjectAccessException
Specified by:
applyToObject in class com.threerings.presents.dobj.DEvent
Throws:
com.threerings.presents.dobj.ObjectAccessException


Copyright © 2011. All Rights Reserved.