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:
Streamable, Prefireable

public class Effect
extends SimpleStreamableObject
implements Prefireable

Represents a stateless event occurring within the scene.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  int _clientOid
          The oid of the client on which the effect was prefired, if any.
protected  ConfigReference<EffectConfig> _config
          The effect configuration.
protected  EffectConfig.Original _original
          The cached config implementation.
protected  float _rotation
          The effect's rotation angle.
protected  EntityKey _target
          The entity upon which to fire the effect, if any.
protected  int _timestamp
          The time at which the effect was fired.
protected  Vector2f _translation
          The effect's translation.
protected static EffectConfig.Original NULL_ORIGINAL
          Used when we can't resolve the effect config.
 
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, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_config

protected ConfigReference<EffectConfig> _config
The effect configuration.


_timestamp

protected int _timestamp
The time at which the effect was fired.


_target

protected EntityKey _target
The entity upon which to fire the effect, if any.


_translation

protected Vector2f _translation
The effect's translation.


_rotation

protected float _rotation
The effect's rotation angle.


_clientOid

protected int _clientOid
The oid of the client on which the effect was prefired, if any.


_original

protected transient EffectConfig.Original _original
The cached config implementation.


NULL_ORIGINAL

protected static final EffectConfig.Original NULL_ORIGINAL
Used when we can't resolve the effect config.

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