barsuift.simLife.time
Class UniverseTimeController

java.lang.Object
  extended by barsuift.simLife.time.UniverseTimeController

public class UniverseTimeController
extends java.lang.Object

Controller for time control on the universe.


Constructor Summary
UniverseTimeController(Universe universe)
           
 
Method Summary
 int getSpeed()
           
 TimeCounter getTimeCounter()
           
 boolean isRunning()
           
 void oneStep()
          Execute one step of the controller.
 void pause()
          Pause the controller.
 void setSpeed(int speed)
           
 void start()
          Start the controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniverseTimeController

public UniverseTimeController(Universe universe)
Method Detail

setSpeed

public void setSpeed(int speed)

getSpeed

public int getSpeed()

start

public void start()
           throws java.lang.IllegalStateException
Start the controller.

A TimeMessenger instance is scheduled to be run every seconds.

Throws:
java.lang.IllegalStateException - if the controller is already running

oneStep

public void oneStep()
Execute one step of the controller.

A TimeMessenger instance is run once.

Throws:
java.lang.IllegalStateException - if the controller is already running

pause

public void pause()
Pause the controller.

The running process is asked to stop, once it has completed its current execution.

Throws:
java.lang.IllegalStateException - if the controller is not running

isRunning

public boolean isRunning()

getTimeCounter

public TimeCounter getTimeCounter()


Copyright © 2010. All Rights Reserved.