|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.action.Actor net.jinx.action.Clock
public abstract class Clock
Clock keeps track of time for a Scene and then activates other Actors by
sending them ClockEvent and IdleEvent objects.
API Stability: Beta.
Field Summary | |
---|---|
protected java.lang.Object |
sync
The synchronization object. |
Constructor Summary | |
---|---|
protected |
Clock(java.lang.String name,
float deltaTime)
Constructs a new Clock. |
Method Summary | |
---|---|
void |
actorAdded(Actor actor,
Scene scene)
Notifies this Clock that an Actor has been added to it's owner. |
void |
actorRemoved(Actor actor,
Scene scene)
Notifies this Clock that an Actor has been removed from it's owner. |
float |
getDeltaTime()
Provides the current change in time value. |
protected void |
processEvent(ActorEvent event)
Does nothing. |
protected void |
sendClockEvent(float dt)
Sends ClockEvents to all ClockSensitive Actors. |
protected void |
sendClockStateEvent(int state)
Sends a ClockStateEvent to all ClockSensitive and IdleSensitive Actors. |
protected void |
sendIdleEvent(float dt,
float i)
Sends an IdleEvent to all the current IdleSensitive Actors. |
void |
setDeltaTime(float deltaTime)
Sets the change in time calue for this Clock. |
Methods inherited from class net.jinx.action.Actor |
---|
checkAllowAdd, getName, getOwner, hashCode, ownerChanged, sendEvent, sendEvent, sendEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.Object sync
Constructor Detail |
---|
protected Clock(java.lang.String name, float deltaTime)
name
- the name of the Clock.deltaTime
- the change in time value for this clock.
java.lang.IllegalArgumentException
- if deltaTime is less than or equal to
zero.Method Detail |
---|
public void setDeltaTime(float deltaTime)
deltaTime
- the change in time value.
java.lang.IllegalArgumentException
- if the value is less than or equal to
zero.public float getDeltaTime()
protected void sendClockStateEvent(int state)
state
- the state constant to use.protected void sendClockEvent(float dt)
dt
- the change in time value.protected void sendIdleEvent(float dt, float i)
dt
- the current change in time for this TimeSource.i
- the interpolation value. Zero means that no time has passed
since the most recent ClockEvent. One means that dt seconds have passed.
Larger values have proportionate meaning.public void actorAdded(Actor actor, Scene scene)
actorAdded
in interface SceneListener
actor
- the Actor to check and then possibly use.scene
- the Scene that actor came from. If this is not the same as
the results of the getOwner() method, then the actor is ignored.public void actorRemoved(Actor actor, Scene scene)
actorRemoved
in interface SceneListener
actor
- the Actor that has been removed from scene.scene
- the scene that actor came from.protected void processEvent(ActorEvent event)
processEvent
in class Actor
event
- the ActorEvent to process.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |