energyTycoon.game
Class Game

java.lang.Object
  extended by java.lang.Thread
      extended by energyTycoon.game.Game
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ClientGame, ServerGame

public abstract class Game
extends java.lang.Thread

Game abstract class

Author:
Leo CARNAUT-DELORD

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int MESS_ALERT
           
static int MESS_INFO
           
static int MESS_PERSO
           
static int MESS_SUCCESS
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
abstract  void compute()
          compute a frame
 City getCity(int cityId)
          return the city of the given id
 int getDay()
           
 int getGameId()
           
 java.lang.String getGameName()
           
 double getHour()
          return moment of the day (0.5 for 12h00, 0.25 for 06h00 ... ans so one)
 int getNbFramePerYear()
          return frame number in a year
 int getNbMaxPlayer()
           
 int getNbPlayer()
           
 int getScriptId()
           
 Season getSeason()
           
 java.lang.String getStringDate(int time)
          get the string date from game timer
 int getTime()
           
 int getWeather()
           
 int getWind()
           
 int getYearTime()
          get timer in the year
 boolean isNight()
          return true if it's the night
abstract  void run()
          run the thread
 void setStartDate(int day, Season season)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESS_PERSO

public static final int MESS_PERSO
See Also:
Constant Field Values

MESS_ALERT

public static final int MESS_ALERT
See Also:
Constant Field Values

MESS_INFO

public static final int MESS_INFO
See Also:
Constant Field Values

MESS_SUCCESS

public static final int MESS_SUCCESS
See Also:
Constant Field Values
Method Detail

getTime

public int getTime()

getWeather

public int getWeather()

getWind

public int getWind()

getSeason

public Season getSeason()

getDay

public int getDay()

getGameName

public java.lang.String getGameName()

getGameId

public int getGameId()

getScriptId

public int getScriptId()

getNbPlayer

public int getNbPlayer()

getNbMaxPlayer

public int getNbMaxPlayer()

compute

public abstract void compute()
compute a frame


run

public abstract void run()
run the thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isNight

public boolean isNight()
return true if it's the night

Returns:
true if it's the night

getHour

public double getHour()
return moment of the day (0.5 for 12h00, 0.25 for 06h00 ... ans so one)

Returns:

getStringDate

public java.lang.String getStringDate(int time)
get the string date from game timer

Parameters:
time -
Returns:

getNbFramePerYear

public int getNbFramePerYear()
return frame number in a year

Returns:

setStartDate

public void setStartDate(int day,
                         Season season)
Parameters:
day -
season -

getCity

public City getCity(int cityId)
return the city of the given id

Parameters:
cityId -
Returns:

getYearTime

public int getYearTime()
get timer in the year

Returns: