|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--spacewar.Game
The Game class is the root of the spacewar game. To start a spacewar game, you can either call the main method, or instantiate this class directly. The synchronization is done by the GameSynchronization aspect at the end of this file.
Fields inherited from class java.lang.Thread |
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals |
Constructor Summary | |
Game(java.lang.String mode)
Advised by: spacewar.Display To run the game, simply instantiate this class. |
Method Summary | |
(package private) void |
|
(package private) void |
addRobot()
|
(package private) void |
clockTick()
Advised by: spacewar.Display |
(package private) void |
error(java.lang.Object o)
|
(package private) int |
getHeight()
|
(package private) Pilot |
getPilot1()
|
(package private) Pilot |
getPilot2()
|
(package private) Registry |
getRegistry()
|
(package private) int |
getWidth()
|
(package private) void |
handleCollisions()
Advised by: coordination.Coordinator |
(package private) static boolean |
isCollision(SpaceObject a,
SpaceObject b)
|
static void |
main(java.lang.String[] args)
To run the game from top level, simply say Java Game, as usual. |
(package private) Player |
newPlayer(int number)
|
(package private) Robot |
newRobot(int number)
|
(package private) Ship |
newShip(Pilot pilot)
Advised by: spacewar.Display2.ShipDA, coordination.Coordinator, spacewar.Display1.ShipDA |
(package private) void |
quit()
|
(package private) void |
resetShips()
|
void |
run()
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, 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 |
Constructor Detail |
public Game(java.lang.String mode)
isDemo
- Controls whether the game runs in demo mode or not. True
means it is a demo, false means it runs in normal 2 player mode.Method Detail |
void()
in class java.lang.Thread
public static void main(java.lang.String[] args)
Registry getRegistry()
Pilot getPilot1()
Pilot getPilot2()
int getWidth()
int getHeight()
public void run()
run
in class java.lang.Thread
void addRobot()
void resetShips()
void quit()
void error(java.lang.Object o)
Player newPlayer(int number)
Robot newRobot(int number)
Ship newShip(Pilot pilot)
void clockTick()
void handleCollisions()
static boolean isCollision(SpaceObject a, SpaceObject b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |