Class Game

  • All Implemented Interfaces:
    IGame, IGameType

    public class Game
    extends java.lang.Object
    implements IGame, IGameType
    Implementation of the game
    Author:
    Andi Hotz, (c) Sahits GmbH, 2011 Created on Sep 16, 2011
    • Field Detail

      • map

        @Autowired
        private IMap map
      • 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
    • 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: IGame
        Set a new game speed
        Specified by:
        setGameSpeed in interface IGame
        Parameters:
        speed - new game speed.
      • handleMessage

        public void handleMessage​(DisplayMessage message)
      • normalSpeed

        public void normalSpeed()
        Description copied from interface: IGame
        Return to normal speed.
        Specified by:
        normalSpeed in interface IGame
      • fastForward

        public void fastForward()
        Description copied from interface: IGame
        Switch to fast forward until the first interuption.
        Specified by:
        fastForward in interface IGame
      • isObjectivReached

        public boolean isObjectivReached()
        Description copied from interface: IGame
        check if the objective of the game is reached. This method may not be called by the server part
        Specified by:
        isObjectivReached in interface IGame
        Returns:
        flag indicating of the game objective has been reached
      • isSinglePlayer

        public boolean isSinglePlayer()
        Description copied from interface: IGameType
        Indicating that the game is a single player game.
        Specified by:
        isSinglePlayer in interface IGameType
        Returns:
        true if the game is singleplayer.
      • getGameSpeed

        public EGameSpeed getGameSpeed()
        Description copied from interface: IGame
        Retrieve the current game speed
        Specified by:
        getGameSpeed in interface IGame
        Returns:
        current game speed
      • gameSpeedProperty

        public javafx.beans.property.ObjectProperty<EGameSpeed> gameSpeedProperty()
        Description copied from interface: IGame
        Property for the game speed.
        Specified by:
        gameSpeedProperty in interface IGame
        Returns:
        property of the current game speed.