public final class Game
extends java.lang.Object
Constructor and Description |
---|
Game(LaunchableGame lgame,
boolean makeUI,
java.lang.ClassLoader loader)
Constructs a game using specific information from the game manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addPlugin(Plugin plugin)
Adds a plugin the the game.
|
boolean |
canCancelTurn() |
boolean |
canSubmitTurn() |
void |
closeWindow()
Closes the window.
|
void |
endGame()
Ends the game.
|
void |
endTurn()
Ends the current turn.
|
GameState |
getGameState()
Returns the current game state.
|
java.awt.Image |
getImage() |
java.awt.Dimension |
getInventoryEntitySize() |
int |
getLocalPlayerId() |
int |
getNbPlugins() |
GamePane |
getPane() |
Plugin |
getPlugin(int i) |
boolean |
isEndOfGame() |
boolean |
isEndOfTurn() |
boolean |
isWindowClosed() |
void |
repaint()
Triggers a complete repaint of the game window.
|
void |
resetTurn()
Resets the turn.
|
void |
run()
Used to start a game.
|
void |
setGameState(GameState gameState)
Modifies the current game state.
|
void |
setLocalPlayerId(int id)
Sets the ID of the local player.
|
void |
submitTurn()
Sends the game state to the server if the turn has ended.
|
public Game(LaunchableGame lgame, boolean makeUI, java.lang.ClassLoader loader)
lgame
- Main class of the game.makeUI
- Set to true if a GUI needs to be created.public GameState getGameState()
public void setGameState(GameState gameState)
gameState
- The new game state.public void resetTurn()
public void run()
public void endTurn()
public void submitTurn()
public boolean isEndOfTurn()
public void endGame()
public GamePane getPane()
public void repaint()
public void addPlugin(Plugin plugin)
plugin
- The plugin to be added.public int getNbPlugins()
public Plugin getPlugin(int i)
i
- Index of the plugin to return.public boolean isEndOfGame()
public void setLocalPlayerId(int id)
id
- ID of the local player.public int getLocalPlayerId()
public boolean canSubmitTurn()
public boolean canCancelTurn()
public java.awt.Dimension getInventoryEntitySize()
public void closeWindow()
public boolean isWindowClosed()
public java.awt.Image getImage()