Class GameStateHandler
- java.lang.Object
-
- ch.sahits.game.openpatrician.server.events.GameStateHandler
-
@Component public class GameStateHandler extends java.lang.Object
- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Jan 18, 2014
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.eventbus.AsyncEventBus
clientServerEventBus
private Date
date
private OpenPatricianServerJFX
server
private org.springframework.context.ApplicationContext
serverContext
private com.google.common.eventbus.AsyncEventBus
serverEventBus
private RandomNameLoader
shipNameLoader
-
Constructor Summary
Constructors Constructor Description GameStateHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleGameStateChange(GameStateChange stateChange)
Handle the GameStateChange events.private void
handleLoadGame(NewGame newGameDTO, boolean withEnvironmentInitialisation)
private void
handleNewGame(NewGame newGameDTO)
private void
initializeEventSystem()
private IHumanPlayer
startupGameEnvironment(NewGame newGameDTO)
private void
unregister()
-
-
-
Field Detail
-
server
@Autowired private OpenPatricianServerJFX server
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
serverEventBus
@Autowired @Qualifier("serverEventBus") private com.google.common.eventbus.AsyncEventBus serverEventBus
-
date
@Autowired private Date date
-
shipNameLoader
@Autowired @Qualifier("shipNameLoader") private RandomNameLoader shipNameLoader
-
serverContext
@Autowired private org.springframework.context.ApplicationContext serverContext
-
-
Method Detail
-
initializeEventSystem
@PostConstruct private void initializeEventSystem()
-
unregister
@PreDestroy private void unregister()
-
handleGameStateChange
public void handleGameStateChange(GameStateChange stateChange)
Handle the GameStateChange events.- Parameters:
stateChange
- change of the game state
-
handleNewGame
private void handleNewGame(NewGame newGameDTO)
-
handleLoadGame
private void handleLoadGame(NewGame newGameDTO, boolean withEnvironmentInitialisation)
-
startupGameEnvironment
private IHumanPlayer startupGameEnvironment(NewGame newGameDTO)
-
-