Class 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
    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 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
    • Constructor Detail

      • ClientViewState

        public ClientViewState()
    • 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)
      • stateProperty

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

        public void setState​(EViewState state)
      • handleConvoyDissolving

        public void handleConvoyDissolving​(ConvoyDisolveEvent event)
      • handleConvoyEvent

        public void handleConvoyEvent​(ConvoyEvent event)
      • handleConvoyCreation

        public void handleConvoyCreation​(ConvoyCreateEvent event)