Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.metacosm.framework.server
Class Scheduler  view Scheduler download Scheduler.java

java.lang.Object
  extended byorg.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.


Field Summary
protected static int MAX_THREAD_DURATION
           
protected static int MAX_TURN_DURATION
           
protected  int maxThreadDuration
           
protected static java.lang.String maxThreadDurationProperty
           
protected  int maxTurnDuration
           
protected static java.lang.String maxTurnDurationProperty
           
protected static int MIN_THREAD_DURATION
           
protected static int MIN_TURN_DURATION
           
protected  int minThreadDuration
           
protected static java.lang.String minThreadDurationProperty
           
protected  int minTurnDuration
           
protected static java.lang.String minTurnDurationProperty
           
private static int SAVING_INTERVAL
          The number of turns between each save of the game
private  int savingInterval
           
private static java.lang.String savingIntervalProperty
           
protected static int THREAD_DURATION
           
protected  int threadDuration
           
protected static java.lang.String threadDurationProperty
           
protected static int TURN_DURATION
           
private static int turnCounter
          Count the number of turns elapsed since the last save
protected  int turnDuration
           
protected static java.lang.String turnDurationProperty
           
 
Constructor Summary
Scheduler()
          The constructor for this class.
 
Method Summary
protected abstract  void doProcessTurn()
          This method must implement a GameLoop algorithm.
private  int getPropertyValue(java.lang.String property, int default_value)
          Get configuration for a property.
 int getTurnCounter()
          Getter for turnCounter
 void processTurn()
          Process a turn of the GameLoop and manage saves of the Game
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

Scheduler

public Scheduler()
The constructor for this class.

Method Detail

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