com.threerings.tudey.data.effect
Class Effect

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.tudey.data.effect.Effect
All Implemented Interfaces:
com.threerings.io.Streamable, Prefireable

public class Effect
extends com.threerings.io.SimpleStreamableObject
implements Prefireable

Represents a stateless event occurring within the scene.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Constructor Summary
Effect()
          No-arg constructor for deserialization.
Effect(ConfigReference<EffectConfig> config, int timestamp, EntityKey target, Vector2f translation, float rotation)
          Creates a new effect.
 
Method Summary
 int getClientOid()
          Returns the oid of the client that (may have) prefired the effect.
 ConfigReference<EffectConfig> getConfig()
          Returns the effect's config reference.
 int getExpiry()
          Returns the time at which this effect expires.
 void getPreloads(ConfigManager cfgmgr, PreloadableSet preloads)
          Adds the resources to preload for this effect into the provided set.
 float getRotation()
          Returns the effect's rotation angle.
 EntityKey getTarget()
          Returns the target of the effect (if any).
 int getTimestamp()
          Returns the time at which the effect was fired.
 Vector2f getTranslation()
          Returns a reference to the effect's translation vector.
 void init(ConfigManager cfgmgr)
          Gives the effect a chance to resolve and cache configuration data after being created or deserialized.
 void setClientOid(int clientOid)
          Sets the oid of the client that (may have) prefired the effect, or zero for none.
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Effect

public Effect(ConfigReference<EffectConfig> config,
              int timestamp,
              EntityKey target,
              Vector2f translation,
              float rotation)
Creates a new effect.


Effect

public Effect()
No-arg constructor for deserialization.

Method Detail

init

public void init(ConfigManager cfgmgr)
Gives the effect a chance to resolve and cache configuration data after being created or deserialized.


getPreloads

public void getPreloads(ConfigManager cfgmgr,
                        PreloadableSet preloads)
Adds the resources to preload for this effect into the provided set.


getConfig

public ConfigReference<EffectConfig> getConfig()
Returns the effect's config reference.


getTimestamp

public int getTimestamp()
Returns the time at which the effect was fired.


getTarget

public EntityKey getTarget()
Returns the target of the effect (if any).


getTranslation

public Vector2f getTranslation()
Returns a reference to the effect's translation vector.


getRotation

public float getRotation()
Returns the effect's rotation angle.


getExpiry

public int getExpiry()
Returns the time at which this effect expires.


setClientOid

public void setClientOid(int clientOid)
Description copied from interface: Prefireable
Sets the oid of the client that (may have) prefired the effect, or zero for none.

Specified by:
setClientOid in interface Prefireable

getClientOid

public int getClientOid()
Description copied from interface: Prefireable
Returns the oid of the client that (may have) prefired the effect.

Specified by:
getClientOid in interface Prefireable


Copyright © 2011. All Rights Reserved.