Class Game
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.impl.Game
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.eventbus.AsyncEventBusclientEventBusprivate com.google.common.eventbus.AsyncEventBusclientServerEventBusprivate static booleanconstructedprivate Difficultydifficultyprivate booleanfastforwardprivate javafx.beans.property.ObjectProperty<EGameSpeed>gameSpeedprivate IMapmapprivate EObjectiveobjectiveprivate booleansingleplayerprivate Datetime
-
Constructor Summary
Constructors Constructor Description Game(EObjective objective, Difficulty difficulty, EGameSpeed speed, boolean singleplayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfastForward()Switch to fast forward until the first interuption.javafx.beans.property.ObjectProperty<EGameSpeed>gameSpeedProperty()Property for the game speed.EGameSpeedgetGameSpeed()Retrieve the current game speedvoidhandleMessage(DisplayMessage message)private voidinit()booleanisObjectivReached()check if the objective of the game is reached.booleanisSinglePlayer()Indicating that the game is a single player game.voidnormalSpeed()Return to normal speed.voidsetGameSpeed(EGameSpeed speed)Set a new game speedprivate voidsetupGamespeed()private voidunregister()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.IGame
getDifficulty, getMap
-
-
-
-
Field Detail
-
map
@Autowired private IMap map
-
objective
private final EObjective objective
-
difficulty
private final Difficulty difficulty
-
gameSpeed
private javafx.beans.property.ObjectProperty<EGameSpeed> gameSpeed
-
fastforward
private boolean fastforward
-
time
@Autowired private Date time
-
singleplayer
private boolean singleplayer
-
clientEventBus
@Autowired @Qualifier("clientEventBus") private com.google.common.eventbus.AsyncEventBus clientEventBus
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
constructed
private static boolean constructed
-
-
Constructor Detail
-
Game
public Game(EObjective objective, Difficulty difficulty, EGameSpeed speed, boolean singleplayer)
-
-
Method Detail
-
init
@PostConstruct private void init()
-
setupGamespeed
private void setupGamespeed()
-
unregister
@PreDestroy private void unregister()
-
setGameSpeed
public void setGameSpeed(EGameSpeed speed)
Description copied from interface:IGameSet a new game speed- Specified by:
setGameSpeedin interfaceIGame- Parameters:
speed- new game speed.
-
handleMessage
public void handleMessage(DisplayMessage message)
-
normalSpeed
public void normalSpeed()
Description copied from interface:IGameReturn to normal speed.- Specified by:
normalSpeedin interfaceIGame
-
fastForward
public void fastForward()
Description copied from interface:IGameSwitch to fast forward until the first interuption.- Specified by:
fastForwardin interfaceIGame
-
isObjectivReached
public boolean isObjectivReached()
Description copied from interface:IGamecheck if the objective of the game is reached. This method may not be called by the server part- Specified by:
isObjectivReachedin interfaceIGame- Returns:
- flag indicating of the game objective has been reached
-
isSinglePlayer
public boolean isSinglePlayer()
Description copied from interface:IGameTypeIndicating that the game is a single player game.- Specified by:
isSinglePlayerin interfaceIGameType- Returns:
- true if the game is singleplayer.
-
getGameSpeed
public EGameSpeed getGameSpeed()
Description copied from interface:IGameRetrieve the current game speed- Specified by:
getGameSpeedin interfaceIGame- Returns:
- current game speed
-
gameSpeedProperty
public javafx.beans.property.ObjectProperty<EGameSpeed> gameSpeedProperty()
Description copied from interface:IGameProperty for the game speed.- Specified by:
gameSpeedPropertyin interfaceIGame- Returns:
- property of the current game speed.
-
-