Class ClientViewState

  • All Implemented Interfaces:
    ch.sahits.game.openpatrician.utilities.service.IPostLoadOperation

    @Component
    @Lazy
    @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class)
    public class ClientViewState
    extends java.lang.Object
    implements ch.sahits.game.openpatrician.utilities.service.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
    As well for the city there is additional information on which city. Once the game is initialized, the getCurrentCityProxy() is always present.
    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  
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientViewState()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EViewState getState()  
      void handleConvoyCreation​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyCreateEvent event)  
      void handleConvoyDissolving​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyDisolveEvent event)  
      void handleConvoyEvent​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyEvent event)  
      void handleSwitchToCity​(ch.sahits.game.openpatrician.event.data.SwitchCity event)  
      void initializeState​(ch.sahits.game.openpatrician.event.data.NewGameClient newGameDTO)
      Initialize the player that goes with this client.
      void postLoad()  
      void setState​(EViewState state)  
      javafx.beans.property.ObjectProperty<EViewState> stateProperty()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clientEventBus

        @Autowired
        @Qualifier("clientEventBus")
        protected com.google.common.eventbus.AsyncEventBus clientEventBus
    • Constructor Detail

      • ClientViewState

        public ClientViewState()
    • Method Detail

      • initializeState

        public void initializeState​(ch.sahits.game.openpatrician.event.data.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​(ch.sahits.game.openpatrician.event.data.SwitchCity event)
      • stateProperty

        public javafx.beans.property.ObjectProperty<EViewState> stateProperty()
      • setState

        public void setState​(EViewState state)
      • postLoad

        public void postLoad()
        Specified by:
        postLoad in interface ch.sahits.game.openpatrician.utilities.service.IPostLoadOperation
      • handleConvoyDissolving

        public void handleConvoyDissolving​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyDisolveEvent event)
      • handleConvoyEvent

        public void handleConvoyEvent​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyEvent event)
      • handleConvoyCreation

        public void handleConvoyCreation​(ch.sahits.game.openpatrician.clientserverinterface.model.event.ConvoyCreateEvent event)