universe.server
Class GameEngine

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--universe.server.GameEngine
All Implemented Interfaces:
java.lang.Runnable

public class GameEngine
extends java.lang.Thread

This is the main GameEngine thread. This class controls all of the turn submittals and turn processing.

Version:
$Id: GameEngine.java,v 1.17 2002/03/03 22:28:01 sstarkey Exp $
Author:
Sean Starkey

Field Summary
private  Database database
           
private  boolean done
           
private  java.lang.String gameName
           
private  GameOptions gameoptions
           
private  boolean gameOptionsSubmitted
           
static java.util.Random randomGen
           
private  boolean running
           
private static GameEngine singleton
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private GameEngine(java.lang.String gameName)
           
 
Method Summary
private  void done()
           
static Database getDatabase()
           
static java.lang.String getGameName()
           
static GameEngine getInstance()
           
(package private) static void initialize(java.lang.String gameName)
           
 boolean isDone()
          Determine if the thread in this class has completed execution.
private  boolean isRunning()
           
 void run()
           
 void stopRunning()
          Stop the game engine thread.
 void submitGameOptions(GameOptions options)
          This function is used to submit and process the game options.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

singleton

private static GameEngine singleton

database

private Database database

gameoptions

private GameOptions gameoptions

gameOptionsSubmitted

private boolean gameOptionsSubmitted

running

private boolean running

done

private boolean done

gameName

private java.lang.String gameName

randomGen

public static java.util.Random randomGen
Constructor Detail

GameEngine

private GameEngine(java.lang.String gameName)
Method Detail

initialize

static void initialize(java.lang.String gameName)

getInstance

public static GameEngine getInstance()

getGameName

public static java.lang.String getGameName()

getDatabase

public static Database getDatabase()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isRunning

private boolean isRunning()

stopRunning

public void stopRunning()
Stop the game engine thread.


isDone

public boolean isDone()
Determine if the thread in this class has completed execution.

Returns:
true if the thread is done, false otherwise

done

private void done()

submitGameOptions

public void submitGameOptions(GameOptions options)
This function is used to submit and process the game options.



Copyright © 2001 Universe Dev Team All Rights Reserved.