|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
de.farafin.snEADy.M_GameEngine
public final class M_GameEngine
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private D_GameInfo |
gameInfo
the gameInfo instance from whitch a copy is given to other modules |
private C_Human[] |
humanInstances
The instances of human Player |
private boolean |
imergencyPaused
flag that controlls if the class is suspended |
private static M_GameEngine |
instance
own instance to prevent multible instanzes |
private GameParameter |
parameter
parameter set of GameParameter |
private D_PlayerData[] |
playerData
data of the managed player |
private M_PlayerHandler |
playerHandler
The instance of the player handler.. the class that handles the player management |
private Player[] |
playerInstances
The player Instances which are loaded |
private C_World |
world
an instance of the world, the class that computes all moves and stuff world also includes the arena as final. if you like to create a new arena, you need to create a new world-object. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface de.farafin.snEADy.I_GameStats |
---|
GAME_ABBORT, GAME_INIT, GAME_PAUSE, GAME_RECOVER, GAME_RUNNING, GAME_SAFE, PROG_END, PROG_INIT |
Fields inherited from interface de.farafin.snEADy.communication.I_PlayFieldConstants |
---|
EXIT, FIELD_B, FIELD_C, FIELD_D, FIELD_E, FIELD_F, FIELD_G, FIELD_H, FIELD_I, FIELD_J, FIELD_K, FIELD_L, FIELD_M, FIELD_N, FIELD_O, FIELD_P, FIELD_Q, FIELD_R, FIELD_S, FIELD_T, FIELD_U, FIELD_V, FIELD_W, FIELD_X, FIELD_Y, FIELD_Z, FREE, GOODY_f, GOODY_g, GOODY_h, GOODY_i, GOODY_j, GOODY_k, GOODY_l, GOODY_m, GOODY_n, GOODY_o, GOODY_p, GOODY_q, GOODY_r, GOODY_s, GOODY_t, GOODY_u, GOODY_v, GOODY_w, GOODY_x, GOODY_y, GOODY_z, LENGTH, PLAYER_0, PLAYER_1, PLAYER_2, PLAYER_3, PLAYER_4, PLAYER_5, PLAYER_6, PLAYER_7, PLAYER_8, PLAYER_9, POINTS, SHORT, SLOW, SPEED, WALL |
Constructor Summary | |
---|---|
private |
M_GameEngine()
constructor of M_GameEngine |
Method Summary | |
---|---|
private boolean |
checkGameState()
checks the gameSate |
protected static void |
destroyInstance(M_GameEngine engine)
destroys the engine - instance to make it free for a new one. |
private D_GameInfo |
generateGameInfo()
to send other modules the current gameState, its necessary to copy the data and send the data to all modules. this method just copys the data and stores them in a gameInfo instance. |
protected D_GameInfo |
getGameInfo()
|
protected static M_GameEngine |
getInstance()
prevents that more than one instance of the class exists in the program |
protected void |
imergencyPause()
pauses/starts the actual player using deprecated methods! |
protected void |
initGame(D_GameInfo initData)
init the game |
protected void |
kill()
stops all threads that are running in the game! |
protected void |
recover(D_RecoverData recoverData)
recover a before safed game |
private D_GameInfo |
reGenerateGameInfo()
|
void |
run()
The main cycle of the game. its a run-method from Thread, M_GameEngine is extended from. |
protected void |
store(D_RecoverData dataStorage)
saves a game |
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private C_World world
C_World
private D_PlayerData[] playerData
D_PlayerData
private Player[] playerInstances
private C_Human[] humanInstances
private M_PlayerHandler playerHandler
M_PlayerHandler
private D_GameInfo gameInfo
private final GameParameter parameter
private static M_GameEngine instance
private boolean imergencyPaused
Constructor Detail |
---|
private M_GameEngine()
getInstance()
Method Detail |
---|
private D_GameInfo generateGameInfo()
private D_GameInfo reGenerateGameInfo()
private boolean checkGameState()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Thread.run()
protected void initGame(D_GameInfo initData)
initData
- protected void recover(D_RecoverData recoverData)
recoverData
- protected void store(D_RecoverData dataStorage)
dataStorage
- protected D_GameInfo getGameInfo()
protected void imergencyPause()
protected void kill()
protected static M_GameEngine getInstance()
protected static void destroyInstance(M_GameEngine engine)
engine
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |