|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.ShallowObject
com.threerings.tudey.server.logic.Logic
com.threerings.tudey.server.logic.ActorLogic
public class ActorLogic
Controls the state of an actor on the server.
| Nested Class Summary | |
|---|---|
static interface |
ActorLogic.CollisionFlagObserver
An interface for objects interested in updates to the actor's collision flags. |
| Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic |
|---|
Logic.ShapeObserver |
| Constructor Summary | |
|---|---|
ActorLogic()
|
|
| Method Summary | |
|---|---|
void |
addCollisionFlagObserver(ActorLogic.CollisionFlagObserver observer)
Adds a listener for changes to the actor's collision flags. |
void |
addShapeObserver(Logic.ShapeObserver observer)
Adds an observer for changes to the logic's shape. |
void |
bodyWillEnter(com.threerings.crowd.data.BodyObject body)
For player-controlled actors, this notifies the logic that the controlling player is about to enter. |
void |
bodyWillLeave(com.threerings.crowd.data.BodyObject body)
For player-controlled actors, this notifies the logic that the controlling player is about to leave. |
void |
destroy(int timestamp,
Logic activator)
Destroys the actor. |
Logic |
getActivator()
Returns a reference to the entity that caused the actor to be spawned, if known/any. |
Actor |
getActor()
Returns a reference to the actor object. |
int |
getCollisionFlags()
Returns the cached collision flags. |
EntityKey |
getEntityKey()
Returns the entity key for this logic, if any. |
ConfigReference<ModelConfig> |
getModel()
Returns a reference to the model associated with this logic, if any. |
Actor |
getPreviousSnapshot()
Returns the previous tick's snapshot of the actor. |
float |
getRotation()
Returns the rotation of this logic for the purpose of spawning actors, etc. |
Shape |
getShape()
Returns a reference to this logic's shape, or returns null for none. |
ShapeElement |
getShapeElement()
Returns a reference to the actor's shape element. |
Actor |
getSnapshot()
Returns the current tick's snapshot of the actor. |
ActorDelta |
getSnapshotDelta()
Returns the delta between the last snapshot of the actor and the current state, or null if the actor has not changed. |
Logic |
getSource()
Returns a reference to the entity that spawned the actor, if known/any. |
String[] |
getTags()
Returns the tags for this logic, if any. |
Vector2f |
getTranslation()
Returns the translation of this logic for the purpose of spawning actors, etc. |
void |
init(TudeySceneManager scenemgr,
ConfigReference<ActorConfig> ref,
ActorConfig.Original config,
int id,
int timestamp,
Vector2f translation,
float rotation,
Actor actor)
Initializes the actor. |
boolean |
isActive()
Determines whether this logic object is still active in the scene. |
boolean |
isDefaultEntrance()
Checks whether this logic object corresponds to a default entrance. |
boolean |
isDestroyed()
Determines whether the actor is destroyed as of the current server tick. |
boolean |
isRemoved()
Determines whether the actor has been removed from the manager. |
boolean |
isStatic()
Checks whether this is a "static" actor. |
void |
move(float x,
float y,
float rotation)
Moves the actor and updates its shape. |
void |
remove()
Removes this actor after it has been destroyed. |
void |
removeCollisionFlagObserver(ActorLogic.CollisionFlagObserver observer)
Removes a collision flag observer. |
void |
removeShapeObserver(Logic.ShapeObserver observer)
Removes a shape observer. |
void |
request(int timestamp,
PawnLogic source,
String name)
Notifies the logic of a client request. |
void |
setActivator(Logic activator)
Sets the reference to the entity that caused the actor to be spawned. |
void |
setSource(Logic source)
Sets the reference to the entity that spawned the actor. |
void |
setVariable(int timestamp,
Logic source,
String name,
Object value)
Sets the value of a variable. |
void |
signal(int timestamp,
Logic source,
String name)
Sends a generic "signal" to the logic. |
void |
transfer(Logic source,
Map<Object,Object> refs)
Transfers state from the specified source logic. |
void |
warp(float x,
float y,
float rotation)
Warps the actor. |
void |
warp(float x,
float y,
float rotation,
float tx,
float ty)
Warps the actor. |
void |
warp(float x,
float y,
float rotation,
float tx,
float ty,
boolean adjust)
Warps the actor. |
| Methods inherited from class com.threerings.tudey.server.logic.Logic |
|---|
getPatrolPath, getSceneManager, getTransform, getTransform, getVariable, init, isVisible, resolveTarget |
| Methods inherited from class com.threerings.util.ShallowObject |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ActorLogic()
| Method Detail |
|---|
public void init(TudeySceneManager scenemgr,
ConfigReference<ActorConfig> ref,
ActorConfig.Original config,
int id,
int timestamp,
Vector2f translation,
float rotation,
Actor actor)
public boolean isStatic()
public void setSource(Logic source)
public Logic getSource()
public void setActivator(Logic activator)
public Logic getActivator()
public int getCollisionFlags()
public void addCollisionFlagObserver(ActorLogic.CollisionFlagObserver observer)
public void removeCollisionFlagObserver(ActorLogic.CollisionFlagObserver observer)
public void bodyWillEnter(com.threerings.crowd.data.BodyObject body)
public void bodyWillLeave(com.threerings.crowd.data.BodyObject body)
public Actor getSnapshot()
public Actor getPreviousSnapshot()
public ActorDelta getSnapshotDelta()
null if the actor has not changed.
public ShapeElement getShapeElement()
public boolean isDestroyed()
public boolean isRemoved()
public void warp(float x,
float y,
float rotation)
public void warp(float x,
float y,
float rotation,
float tx,
float ty)
public void warp(float x,
float y,
float rotation,
float tx,
float ty,
boolean adjust)
adjust - if true, adjusts the location as when spawning to avoid intersecting other
actors.
public void move(float x,
float y,
float rotation)
public void destroy(int timestamp,
Logic activator)
public void remove()
public Actor getActor()
HasActor
getActor in interface HasActorpublic String[] getTags()
Logic
getTags in class Logicpublic boolean isDefaultEntrance()
Logic
isDefaultEntrance in class Logicpublic boolean isActive()
Logic
isActive in class Logicpublic EntityKey getEntityKey()
Logic
getEntityKey in class Logicpublic Vector2f getTranslation()
Logic
getTranslation in class Logicpublic float getRotation()
Logic
getRotation in class Logicpublic Shape getShape()
Logicnull for none.
getShape in class Logicpublic void addShapeObserver(Logic.ShapeObserver observer)
Logic
addShapeObserver in class Logicpublic void removeShapeObserver(Logic.ShapeObserver observer)
Logic
removeShapeObserver in class Logicpublic ConfigReference<ModelConfig> getModel()
Logic
getModel in class Logic
public void signal(int timestamp,
Logic source,
String name)
Logic
signal in class Logictimestamp - the signal timestamp.source - the source of the signal.
public void setVariable(int timestamp,
Logic source,
String name,
Object value)
Logic
setVariable in class Logictimestamp - the set timestamp.source - the source of the request.
public void request(int timestamp,
PawnLogic source,
String name)
Logic
request in class Logictimestamp - the request timestamp.source - the source of the request.
public void transfer(Logic source,
Map<Object,Object> refs)
Logic
transfer in class Logic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||