Class UpdateInfo

  • All Implemented Interfaces:
    java.io.Serializable

    public class UpdateInfo
    extends java.lang.Object
    implements java.io.Serializable
    Information about current game status. This only references the necessary objects for updates of graphics and sound.
    See Also:
    Serialized Form
    • Field Detail

      • soundUpdate

        protected SoundFxUpdate soundUpdate
        The update info for the sound fx.
      • levelUpdate

        protected Level levelUpdate
        The level.
      • animationUpdate

        protected AnimationInfo animationUpdate
        The level.
    • Constructor Detail

      • UpdateInfo

        public UpdateInfo​(Level levelUpdate,
                          AbstractLevelInfo levelInfo,
                          Field fieldUpdate,
                          SoundFxUpdate soundUpdate,
                          EffectsInfo effectsUpdate,
                          AnimationInfo animation,
                          int roundCount,
                          java.util.List<Figure> figures,
                          int levelCount,
                          int modeCount,
                          boolean isTutorial,
                          boolean isShowingFlashAnimation,
                          int flashAnimationIndex,
                          GameMode gameState,
                          java.lang.String message,
                          int messageColor,
                          int playerCount,
                          Figure lastWinner,
                          boolean isShowingFigureVisisbility,
                          boolean isFlashing,
                          boolean isGameFinished,
                          Shop shop)
        Creates a new UpdateInfo.
        Parameters:
        levelUpdate - The Level update.
        levelInfo - The Level info.
        fieldUpdate - the field update.
        soundUpdate - The sound update.
        effectsUpdate - The effects update.
        animation - The AnimationInfo.
        roundCount - The round count.
        figures - The list of figures.
        levelCount - The level count.
        modeCount - The mode counter.
        isTutorial - Flag, if tutorial.
        isShowingFlashAnimation - Flag, if showing flash animation.
        flashAnimationIndex - Flash aimation index.
        gameState - GameState.
        message - Game message.
        messageColor - Game message Color.
        playerCount - Player count.
        lastWinner - The last winner.
        isShowingFigureVisisbility - Flag, if showing figure visibility.y
        isFlashing - Flag, if flashing.
        isGameFinished - Flag, if game is finished.
        shop - The shop.
      • UpdateInfo

        public UpdateInfo()
        Creates an empty update info.
    • Method Detail

      • getAnimationInfo

        public AnimationInfo getAnimationInfo()
        Gets the level.
        Returns:
        The level.
      • getLevel

        public Level getLevel()
        Gets the level.
        Returns:
        The level.
      • getSoundFxUpdate

        public SoundFxUpdate getSoundFxUpdate()
        Gets the sound fx update.
        Returns:
        The Sound fx update.
      • getEffectsUpdate

        public EffectsInfo getEffectsUpdate()
        Gets the effects update.
        Returns:
        The effects update.
      • getLevelFigures

        public java.util.List<Figure> getLevelFigures()
        Gets the figures in this update.
        Returns:
        The list of figures.
      • getRoundCount

        public int getRoundCount()
        Gets this updates round count.
        Returns:
        The round count
      • toString

        public java.lang.String toString()
        Returns a string representation of the update info.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation.
      • getLevelCount

        public int getLevelCount()
        Gets the current level count.
        Returns:
        The level count.
      • getModeCount

        public int getModeCount()
        Returns the controllers mode counter.
        Returns:
        The mode counter.
      • isTutorial

        public boolean isTutorial()
        Checks, if the tutorial is played.
        Returns:
        Flag, if tutorial is played.
      • isShowingFlashAnimation

        public boolean isShowingFlashAnimation()
        Checks, if a FlashAnimation is currently shown.
        Returns:
        Flag, if a FlashAnimation is currently shown.
      • getFlashAnimationIndex

        public int getFlashAnimationIndex()
        Gets the index of the current FlashAnimation.
        Returns:
        The flash animation index.
      • getState

        public GameMode getState()
        Gets the index of the current FlashAnimation.
        Returns:
        The game state.
      • getMessage

        public java.lang.String getMessage()
        Gets the index of the current FlashAnimation.
        Returns:
        The message.
      • getMessageColor

        public int getMessageColor()
        Gets the index of the current FlashAnimation.
        Returns:
        The message.
      • getPlayerCount

        public int getPlayerCount()
        Gets the number of players.
        Returns:
        The number of players.
      • isShowingFigureVisisbility

        public boolean isShowingFigureVisisbility()
        Checks, if the figures visibility state should be shown in the player panel.
        Returns:
        True, if visibility state should be shown.
      • getField

        public Field getField()
        Gets the field state.
        Returns:
        The field.
      • getShop

        public Shop getShop()
        Gets the shop.
        Returns:
        The shop.
      • isFlashing

        public boolean isFlashing()
        Checks, if game is flashing between two levels.
        Returns:
        true, if flashing
      • isGameFinished

        public boolean isGameFinished()
        Checks, if the game is finished.
        Returns:
        Flag, if game is finshed.
      • equals

        public boolean equals​(java.lang.Object o)
        Checks, if the other object is an UpdateInfo with the same ID.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Checks, if the other object is an UpdateInfo with the same ID.
        Overrides:
        hashCode in class java.lang.Object
      • getLastWinner

        public Figure getLastWinner()
        Gets the winner of the last level.
        Returns:
        the lastWinner
      • getLevelInfo

        public AbstractLevelInfo getLevelInfo()
        Gets the current level info.
        Returns:
        the levelInfo