Package com.starpoints.game
Class UpdateInfo
- java.lang.Object
-
- com.starpoints.game.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 Summary
Fields Modifier and Type Field Description protected AnimationInfo
animationUpdate
The level.protected Level
levelUpdate
The level.protected SoundFxUpdate
soundUpdate
The update info for the sound fx.
-
Constructor Summary
Constructors Constructor Description UpdateInfo()
Creates an empty update info.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Checks, if the other object is an UpdateInfo with the same ID.AnimationInfo
getAnimationInfo()
Gets the level.EffectsInfo
getEffectsUpdate()
Gets the effects update.Field
getField()
Gets the field state.int
getFlashAnimationIndex()
Gets the index of the current FlashAnimation.Figure
getLastWinner()
Gets the winner of the last level.Level
getLevel()
Gets the level.int
getLevelCount()
Gets the current level count.java.util.List<Figure>
getLevelFigures()
Gets the figures in this update.AbstractLevelInfo
getLevelInfo()
Gets the current level info.java.lang.String
getMessage()
Gets the index of the current FlashAnimation.int
getMessageColor()
Gets the index of the current FlashAnimation.int
getModeCount()
Returns the controllers mode counter.int
getPlayerCount()
Gets the number of players.int
getRoundCount()
Gets this updates round count.Shop
getShop()
Gets the shop.SoundFxUpdate
getSoundFxUpdate()
Gets the sound fx update.GameMode
getState()
Gets the index of the current FlashAnimation.int
hashCode()
Checks, if the other object is an UpdateInfo with the same ID.boolean
isFlashing()
Checks, if game is flashing between two levels.boolean
isGameFinished()
Checks, if the game is finished.boolean
isShowingFigureVisisbility()
Checks, if the figures visibility state should be shown in the player panel.boolean
isShowingFlashAnimation()
Checks, if a FlashAnimation is currently shown.boolean
isTutorial()
Checks, if the tutorial is played.java.lang.String
toString()
Returns a string representation of the update info.
-
-
-
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.yisFlashing
- 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 classjava.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 classjava.lang.Object
-
hashCode
public int hashCode()
Checks, if the other object is an UpdateInfo with the same ID.- Overrides:
hashCode
in classjava.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
-
-