net.jinx.action
Class SteppingClock

java.lang.Object
  extended by net.jinx.action.Actor
      extended by net.jinx.action.Clock
          extended by net.jinx.action.SteppingClock
All Implemented Interfaces:
OwnerListener, SceneListener

public class SteppingClock
extends Clock

Clock extension that is used to manually step time in the simulation.

API Stability: Alpha.


Field Summary
 
Fields inherited from class net.jinx.action.Clock
sync
 
Constructor Summary
SteppingClock(java.lang.String name, float deltaTime)
          Constructs a new RealTimeClock.
 
Method Summary
 void start()
          Sends a start event to all the sensitive actors, but only if the clock isn't in a started state.
 void step()
          Steps the clock.
 void stop()
          Sends a stop event to all the sensitive actors, but only if the clock is in a started state.
 
Methods inherited from class net.jinx.action.Clock
actorAdded, actorRemoved, getDeltaTime, processEvent, sendClockEvent, sendClockStateEvent, sendIdleEvent, setDeltaTime
 
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
 

Constructor Detail

SteppingClock

public SteppingClock(java.lang.String name,
                     float deltaTime)
Constructs a new RealTimeClock.

Parameters:
name - the name of the Clock.
deltaTime - the change in time value for this clock.
Throws:
java.lang.IllegalArgumentException - if deltaTime is less than or equal to zero.
Method Detail

start

public void start()
Sends a start event to all the sensitive actors, but only if the clock isn't in a started state.


step

public void step()
Steps the clock. If the clock isn't in a started state, then start() is called.

First, a ClockEvent is sent. Next, an IdleEvent is sent with an interpolation value of one.


stop

public void stop()
Sends a stop event to all the sensitive actors, but only if the clock is in a started state.