java.lang.Object
org.metacosm.framework.server.Scheduler
- public abstract class Scheduler
- extends java.lang.Object
This class is the GameLoop algorithm (see GameLoop-RFC).
It performs saves of the Game too.
|
Constructor Summary |
Scheduler()
The constructor for this class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SAVING_INTERVAL
private static final int SAVING_INTERVAL
- The number of turns between each save of the game
- See Also:
- Constant Field Values
savingIntervalProperty
private static final java.lang.String savingIntervalProperty
- See Also:
- Constant Field Values
savingInterval
private int savingInterval
turnCounter
private static int turnCounter
- Count the number of turns elapsed since the last save
THREAD_DURATION
protected static final int THREAD_DURATION
- See Also:
- Constant Field Values
MIN_THREAD_DURATION
protected static final int MIN_THREAD_DURATION
- See Also:
- Constant Field Values
MAX_THREAD_DURATION
protected static final int MAX_THREAD_DURATION
- See Also:
- Constant Field Values
TURN_DURATION
protected static final int TURN_DURATION
- See Also:
- Constant Field Values
MIN_TURN_DURATION
protected static final int MIN_TURN_DURATION
- See Also:
- Constant Field Values
MAX_TURN_DURATION
protected static final int MAX_TURN_DURATION
- See Also:
- Constant Field Values
threadDurationProperty
protected static final java.lang.String threadDurationProperty
- See Also:
- Constant Field Values
minThreadDurationProperty
protected static final java.lang.String minThreadDurationProperty
- See Also:
- Constant Field Values
maxThreadDurationProperty
protected static final java.lang.String maxThreadDurationProperty
- See Also:
- Constant Field Values
turnDurationProperty
protected static final java.lang.String turnDurationProperty
- See Also:
- Constant Field Values
minTurnDurationProperty
protected static final java.lang.String minTurnDurationProperty
- See Also:
- Constant Field Values
maxTurnDurationProperty
protected static final java.lang.String maxTurnDurationProperty
- See Also:
- Constant Field Values
threadDuration
protected int threadDuration
minThreadDuration
protected int minThreadDuration
maxThreadDuration
protected int maxThreadDuration
turnDuration
protected int turnDuration
minTurnDuration
protected int minTurnDuration
maxTurnDuration
protected int maxTurnDuration
Scheduler
public Scheduler()
- The constructor for this class.
getPropertyValue
private final int getPropertyValue(java.lang.String property,
int default_value)
- Get configuration for a property. If it is null, the default value is used.
processTurn
public void processTurn()
- Process a turn of the GameLoop and manage saves of the Game
doProcessTurn
protected abstract void doProcessTurn()
- This method must implement a GameLoop algorithm.
getTurnCounter
public int getTurnCounter()
- Getter for turnCounter