|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.game.AbstractGame
vooga.aiEngine.Dev.AIDemo
public class AIDemo
An instance of the abstract game class, for testing and developing AI algorithms
Constructor Summary | |
---|---|
AIDemo(GameManager manager)
|
Method Summary | |
---|---|
boolean |
endGame()
Ends the current game. |
boolean |
endLevel()
Ends the current level. |
java.lang.Integer[] |
getAllowedPlayerNumbers()
Specifies what number of players are allowed in a network game. |
CameraController |
getCameraController()
Provides access to the CameraController for this game. |
void |
initPlayers(AIDemoItem user,
AIDemoItem ai)
Reinitializes the game with appropriate game items and the ai controller |
boolean |
quitGame()
Quits the current game. |
void |
setControls()
Establishes which events are triggered by which key strokes |
boolean |
startGame()
Creates the demo environment with properly instantiated game items |
boolean |
startLevel()
Initializes anything necessary for a level to start, and starts the level. |
void |
whenPaused(boolean gameLoopPaused)
Determines what should occur game-wise during an attempt to pause a game. |
void |
whenResumed()
Defines what should occur game-wise during an attempt to resume the game. |
Methods inherited from class vooga.gameEngine.game.AbstractGame |
---|
getManager, loadLevel, loadLevel, pauseStatusChanged, removeAllKeyInputs, removeAllKeyInputs, removeKeyInput, restartLevel, setKeyInput, setKeyInput, setMouseInput |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AIDemo(GameManager manager)
Method Detail |
---|
public void setControls()
public boolean endGame()
AbstractGame
AbstractGame
when it is determined that the game is over.
endGame
in class AbstractGame
public boolean endLevel()
AbstractGame
AbstractGame
when it is determined that the current level
is over. Note: There is a EndLevelListener
-EndLevelEvent
pair provided for convenience. If used, the
endLevelRequested
method of the
EndLevelListener
should contain a call to this method.
endLevel
in class AbstractGame
public java.lang.Integer[] getAllowedPlayerNumbers()
AbstractGame
Array
of
Integers specifying which numbers
of players are allowed during network play. Thus a game which supports 2 and 4 players
but not 3 should return an array {2,4}. It is unlikely that a network game would ever allow
a single player and thus should not return {1,...}. Games which are not networked need not implement this method.
- Specified by:
getAllowedPlayerNumbers
in class AbstractGame
- Returns:
- An array specifying all allowed numbers of players for a
networked instance of a game.
public CameraController getCameraController()
AbstractGame
CameraController
for this game. This
method will be called by the GameManager
in order to set the
CameraController
.
getCameraController
in class AbstractGame
CameraController
public boolean quitGame()
AbstractGame
AbstractGame.endGame()
in that this method
would be called if the user attempts to quit in the middle of a game.
This method should be called by the instance of an
AbstractGame
when it is determined that a quit is desired.
quitGame
in class AbstractGame
public boolean startGame()
startGame
in class AbstractGame
public boolean startLevel()
AbstractGame
AbstractGame.loadLevel(java.util.Collection extends java.lang.Object>)
, so all
GameItems
s have already been loaded. Note: There is a
StartLevelListener
-StartLevelEvent
pair provided for
convenience. If used, the startLevelRequested
method of the
StartLevelListener
should contain a call to this method.
Moreover, if one has a collection of items that define a particular level
or a file that contains such items, this method can call
AbstractGame.loadLevel(Collection)
or AbstractGame.loadLevel(File)
rather than
adding them to the manager directly.
startLevel
in class AbstractGame
public void whenPaused(boolean gameLoopPaused)
AbstractGame
AbstractGame.pauseStatusChanged(PauseEvent)
.
whenPaused
in class AbstractGame
gameLoopPaused
- whether the game loop was successfully pausedpublic void initPlayers(AIDemoItem user, AIDemoItem ai)
player
- ai
- public void whenResumed()
AbstractGame
AbstractGame.pauseStatusChanged(PauseEvent)
.
whenResumed
in class AbstractGame
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |