com.threerings.tudey.data.actor
Class Agent

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
                  extended by com.threerings.tudey.data.actor.Agent
All Implemented Interfaces:
Deltable, com.threerings.io.Streamable, Copyable, Cloneable

public class Agent
extends Active

An autonomous agent controlled by the computer.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
static int LAST_FLAG
          The value of the last flag defined in this class.
static int TURNING_LEFT
          A flag indicating that the actor is turning left.
static int TURNING_RIGHT
          A flag indicating that the actor is turning right.
 
Fields inherited from class com.threerings.tudey.data.actor.Active
LAST_ACTIVITY, NONE
 
Fields inherited from class com.threerings.tudey.data.actor.Mobile
MOVING
 
Fields inherited from class com.threerings.tudey.data.actor.Actor
WARP
 
Constructor Summary
Agent()
          No-arg constructor for deserialization.
Agent(ConfigReference<ActorConfig> config, int id, int created, Vector2f translation, float rotation)
          Creates a new agent.
 
Method Summary
 float getSpeed()
          Returns the (base) speed of the actor.
 int getTurnDirection()
          Returns the direction of rotation (+1 if counterclockwise, -1 if clockwise, 0 if none).
 float getTurnRate()
          Returns the rate of turning (radians per second).
 void setSpeed(float speed)
          Set the speed.
 void setTurnDirection(int dir)
          Sets the turn direction.
 
Methods inherited from class com.threerings.tudey.data.actor.Active
copy, createAdvancer, equals, getActivity, getActivityStarted, hashCode, interpolate, setActivity, setActivity, setActivityStarted
 
Methods inherited from class com.threerings.tudey.data.actor.Mobile
addStepLimiter, extrapolate, getDirection, getMaxStep, getMaxStepSquared, 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

TURNING_LEFT

public static final int TURNING_LEFT
A flag indicating that the actor is turning left.

See Also:
Constant Field Values

TURNING_RIGHT

public static final int TURNING_RIGHT
A flag indicating that the actor is turning right.

See Also:
Constant Field Values

LAST_FLAG

public static final int LAST_FLAG
The value of the last flag defined in this class.

See Also:
Constant Field Values
Constructor Detail

Agent

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


Agent

public Agent()
No-arg constructor for deserialization.

Method Detail

setTurnDirection

public void setTurnDirection(int dir)
Sets the turn direction.


getSpeed

public float getSpeed()
Description copied from class: Mobile
Returns the (base) speed of the actor.

Overrides:
getSpeed in class Mobile

setSpeed

public void setSpeed(float speed)
Set the speed.


getTurnDirection

public int getTurnDirection()
Description copied from class: Mobile
Returns the direction of rotation (+1 if counterclockwise, -1 if clockwise, 0 if none).

Overrides:
getTurnDirection in class Mobile

getTurnRate

public float getTurnRate()
Description copied from class: Mobile
Returns the rate of turning (radians per second).

Overrides:
getTurnRate in class Mobile


Copyright © 2011. All Rights Reserved.