|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.core.GameEngine
public class GameEngine
Main class for the VOOGA Game Engine. The GameEngine
contains
the game loop, which at a simple level, consists of updating and then
displaying the game.
Constructor Summary | |
---|---|
GameEngine(java.lang.Class<? extends AbstractGame> gameClass)
Creates a GameEngine object provided Class of
the AbstractGame to be played. |
|
GameEngine(java.lang.Class<? extends AbstractGame> gameClass,
boolean isReplayMode)
NOTE: This constructor should be used by the replay module when hoping to replay a game. |
|
GameEngine(java.lang.Class<? extends AbstractGame> gameClass,
int playerNo,
int totalPlayers,
VoogaGameClient networkClient)
Constructor for a networked instance of a game and game engine. |
|
GameEngine(java.lang.Class<? extends AbstractGame> gameClass,
int playerNo,
int totalPlayers,
VoogaGameClient networkClient,
VoogaSave replay,
java.util.Collection<? extends java.util.EventListener> gameStatusListeners)
Constructor for a networked instance of a game and game engine that can be replayed. |
|
GameEngine(java.lang.Class<? extends AbstractGame> gameClass,
VoogaSave replay,
java.util.Collection<? extends java.util.EventListener> gameStatusListeners)
Creates a GameEngine object provided Class of
the AbstractGame to be played and the VoogaSave
object, which stores game time as well as any events fired due to
user/network input. |
Method Summary | |
---|---|
AbstractGame |
getGame()
Simple getter for the AbstractGame . |
javax.swing.JComponent |
getGamePanel()
Simple getter method for the panel in which the game is displayed. |
HumanController |
getHumanController()
Simple getter for the HumanController for the game. |
NetworkController |
getNetworkController()
Simple getter for the NetworkController for the game. |
TimingController |
getTimingController()
Simple getter for the TimingController for the game. |
boolean |
isGameLoopRunning()
Returns whether or not the game loop is currently running. |
boolean |
pauseGameLoop()
Attempts to pause the game loop. |
void |
resumeGameLoop()
Attempts to resume the game loop (if the game loop were paused). |
void |
run()
Simulates the execution of a game. |
void |
shutDown()
Stops the game loop and all components associated with the game which is currently running. |
void |
startGameLoop()
Starts the game loop |
void |
stepThroughGameLoop(int numSteps)
Runs the specified number of iterations through the game loop (in terms of number of times game state is update, not frames) before repainting the canvas. |
void |
stopGameLoop()
Stops the Game Loop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GameEngine(java.lang.Class<? extends AbstractGame> gameClass)
GameEngine
object provided Class
of
the AbstractGame
to be played. Instantiates the various
components needed to execute the game.
gameClass
- the Class
of the game to be run using this
engine.public GameEngine(java.lang.Class<? extends AbstractGame> gameClass, VoogaSave replay, java.util.Collection<? extends java.util.EventListener> gameStatusListeners)
GameEngine
object provided Class
of
the AbstractGame
to be played and the VoogaSave
object, which stores game time as well as any events fired due to
user/network input. Instantiates the various components needed to execute
the game.
gameClass
- the Class
of the game to be run using this
engine.replay
- the VoogaSave
object to which time and
input/network-caused events will be sentgameStatusListeners
- the Collection
of EventListeners
to
be notified of important information regarding the game
status, such as the score or any achievements madepublic GameEngine(java.lang.Class<? extends AbstractGame> gameClass, int playerNo, int totalPlayers, VoogaGameClient networkClient)
gameClass
- playerNo
- totalPlayers
- networkClient
- public GameEngine(java.lang.Class<? extends AbstractGame> gameClass, int playerNo, int totalPlayers, VoogaGameClient networkClient, VoogaSave replay, java.util.Collection<? extends java.util.EventListener> gameStatusListeners)
gameClass
- playerNo
- totalPlayers
- networkClient
- replay
- gameStatusListeners
- the Collection
of EventListeners
to
be notified of important information regarding the game
status, such as the score or any achievements madepublic GameEngine(java.lang.Class<? extends AbstractGame> gameClass, boolean isReplayMode)
GameEngine
object provided
Class
of the AbstractGame
to be played and whether
or not the GameEngine
should enter into replay mode. If
isReplayMode is set to false, this is equivalent to using the
GameEngine(Class)
constructor.
gameClass
- the Class
of the game to be run using this
engine.isReplayMode
- true if the game should enter replay mode; false otherwiseMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void startGameLoop()
public void stopGameLoop()
public boolean pauseGameLoop()
public void resumeGameLoop()
public void stepThroughGameLoop(int numSteps)
public void shutDown()
public javax.swing.JComponent getGamePanel()
public boolean isGameLoopRunning()
public HumanController getHumanController()
HumanController
for the game. Intended to
be called only for the purposes of replaying a game.
HumanController
public NetworkController getNetworkController()
NetworkController
for the game. Intended to
be called only for the purposes of replaying a game.
NetworkController
public TimingController getTimingController()
TimingController
for the game. Intended to
be called only for the purposes of replaying a game.
TimingController
public AbstractGame getGame()
AbstractGame
. Implemented for the
development team.
AbstractGame
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |