com.threerings.tudey.data.actor
Class Active

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.data.actor.Actor
          extended by com.threerings.tudey.data.actor.Mobile
              extended by com.threerings.tudey.data.actor.Active
All Implemented Interfaces:
Deltable, com.threerings.io.Streamable, Copyable, Cloneable
Direct Known Subclasses:
Agent, Pawn

public class Active
extends Mobile

An actor capable of performing activities.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
static int LAST_ACTIVITY
          The last activity defined in this class.
static int NONE
          Indicates that no activity is being performed.
 
Fields inherited from class com.threerings.tudey.data.actor.Mobile
LAST_FLAG, MOVING
 
Fields inherited from class com.threerings.tudey.data.actor.Actor
WARP
 
Constructor Summary
Active()
          No-arg constructor for deserialization.
Active(ConfigReference<ActorConfig> config, int id, int created, Vector2f translation, float rotation)
          Creates a new active actor.
 
Method Summary
 Object copy(Object dest)
          Creates a copy of this object, (re)populating the supplied destination object if possible.
 ActorAdvancer createAdvancer(ActorAdvancer.Environment environment, int timestamp)
          Creates an advancer for the actor.
 boolean equals(Object other)
           
 int getActivity()
          Returns the activity identifier.
 int getActivityStarted()
          Returns the activity timestamp.
 int hashCode()
           
 Actor interpolate(Actor other, int start, int end, int timestamp, Actor result)
          Interpolates between the state of this actor and that of the specified other, placing the result in the provided object.
 void setActivity(int activity)
          Sets the activity identifier.
 void setActivity(int activity, int started)
          Sets both the activity and the start timestamp.
 void setActivityStarted(int started)
          Sets the activity timestamp.
 
Methods inherited from class com.threerings.tudey.data.actor.Mobile
addStepLimiter, extrapolate, getDirection, getMaxStep, getMaxStepSquared, getSpeed, getTurnDirection, getTurnRate, removeStepLimiter, setDirection, setMaxStep, step
 
Methods inherited from class com.threerings.tudey.data.actor.Actor
canCollide, canCollide, clear, getCollisionFlags, getCollisionMask, getConfig, getCreated, getDestroyed, getFlags, getId, getOriginal, getPreloads, getRotation, getTranslation, init, isClientControlled, isDirty, isSet, maybeCreateAdvancer, set, set, setConfig, setDestroyed, setDirty, setFlags, setRotation, setTranslation, toString
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Indicates that no activity is being performed.

See Also:
Constant Field Values

LAST_ACTIVITY

public static final int LAST_ACTIVITY
The last activity defined in this class.

See Also:
Constant Field Values
Constructor Detail

Active

public Active(ConfigReference<ActorConfig> config,
              int id,
              int created,
              Vector2f translation,
              float rotation)
Creates a new active actor.


Active

public Active()
No-arg constructor for deserialization.

Method Detail

setActivity

public void setActivity(int activity,
                        int started)
Sets both the activity and the start timestamp.


setActivity

public void setActivity(int activity)
Sets the activity identifier.


getActivity

public int getActivity()
Returns the activity identifier.


setActivityStarted

public void setActivityStarted(int started)
Sets the activity timestamp.


getActivityStarted

public int getActivityStarted()
Returns the activity timestamp.


interpolate

public Actor interpolate(Actor other,
                         int start,
                         int end,
                         int timestamp,
                         Actor result)
Description copied from class: Actor
Interpolates between the state of this actor and that of the specified other, placing the result in the provided object.

Overrides:
interpolate in class Actor
start - the start time (the timestamp of this actor).
end - the end time (the timestamp of the other actor).
timestamp - the desired time (the timestamp of the result).

createAdvancer

public ActorAdvancer createAdvancer(ActorAdvancer.Environment environment,
                                    int timestamp)
Description copied from class: Actor
Creates an advancer for the actor.

Overrides:
createAdvancer in class Mobile

copy

public Object copy(Object dest)
Description copied from interface: Copyable
Creates a copy of this object, (re)populating the supplied destination object if possible.

Specified by:
copy in interface Copyable
Overrides:
copy in class Mobile
Returns:
either a reference to the destination object, if it could be repopulated, or a new object containing the copied state.

equals

public boolean equals(Object other)
Overrides:
equals in class Mobile

hashCode

public int hashCode()
Overrides:
hashCode in class Mobile


Copyright © 2011. All Rights Reserved.