Class ClientViewState
- java.lang.Object
-
- ch.sahits.game.openpatrician.display.ClientViewState
-
- All Implemented Interfaces:
IPostLoadOperation
@Component @Lazy @DependentInitialisation(StartNewGameBean.class) public class ClientViewState extends java.lang.Object implements IPostLoadOperation
This is the state that represents the actual state of what the client currently displayes. This differeciates between the actual states:- City
- Map
- Sea
- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 15, 2014
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.eventbus.AsyncEventBus
clientEventBus
private com.google.common.eventbus.AsyncEventBus
clientServerEventBus
private org.springframework.context.ApplicationContext
context
private java.util.Optional<ICityPlayerProxyJFX>
currentCityProxy
proxy for the city is only present when the state is cityprivate org.slf4j.Logger
logger
private IHumanPlayer
player
The player behind the clientprivate javafx.beans.property.ObjectProperty<EViewState>
state
Main state
-
Constructor Summary
Constructors Constructor Description ClientViewState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EViewState
getState()
void
handleConvoyCreation(ConvoyCreateEvent event)
void
handleConvoyDissolving(ConvoyDisolveEvent event)
void
handleConvoyEvent(ConvoyEvent event)
void
handleSwitchToCity(SwitchCity event)
private void
initEventBus()
void
initializeState(NewGameClient newGameDTO)
Initialize the player that goes with this client.void
postLoad()
Action that is to be executed after the loading of the savegame.void
setState(EViewState state)
javafx.beans.property.ObjectProperty<EViewState>
stateProperty()
private void
unregister()
-
-
-
Field Detail
-
logger
private final org.slf4j.Logger logger
-
state
private javafx.beans.property.ObjectProperty<EViewState> state
Main state
-
currentCityProxy
private java.util.Optional<ICityPlayerProxyJFX> currentCityProxy
proxy for the city is only present when the state is city
-
player
private IHumanPlayer player
The player behind the client
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
clientEventBus
@Autowired @Qualifier("clientEventBus") protected com.google.common.eventbus.AsyncEventBus clientEventBus
-
context
@Autowired private org.springframework.context.ApplicationContext context
-
-
Method Detail
-
initEventBus
@PostConstruct private void initEventBus()
-
unregister
@PreDestroy private void unregister()
-
initializeState
public void initializeState(NewGameClient newGameDTO)
Initialize the player that goes with this client. The player does not change later on,- Parameters:
newGameDTO
- parameter object for the new game
-
handleSwitchToCity
public void handleSwitchToCity(SwitchCity event)
-
getState
public EViewState getState()
-
stateProperty
public javafx.beans.property.ObjectProperty<EViewState> stateProperty()
-
setState
public void setState(EViewState state)
-
postLoad
public void postLoad()
Description copied from interface:IPostLoadOperation
Action that is to be executed after the loading of the savegame.- Specified by:
postLoad
in interfaceIPostLoadOperation
-
handleConvoyDissolving
public void handleConvoyDissolving(ConvoyDisolveEvent event)
-
handleConvoyEvent
public void handleConvoyEvent(ConvoyEvent event)
-
handleConvoyCreation
public void handleConvoyCreation(ConvoyCreateEvent event)
-
-