Class GameLogEntry


  • public class GameLogEntry
    extends java.lang.Object
    Class representing an entry for the GameLog.
    • Constructor Detail

      • GameLogEntry

        public GameLogEntry​(java.lang.String message,
                            int roundNumber,
                            int playerNumber,
                            boolean validRound,
                            GameLogEntry.RoundTitle title)
        Constructor for the entry.
        Parameters:
        message - Message of the entry
        roundNumber - Round number of the entry
        playerNumber - Player number of the entry
        validRound - Flag telling if it was a valid round
        title - GameLogEntry.RoundTitle of the entry
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Returns the message of the entry.
        Returns:
        The message of the entry
      • getRoundNumber

        public int getRoundNumber()
        Returns the round number of the entry. Will be -1 if round was invalid.
        Returns:
        The round number of the entry
      • getPlayerNumber

        public int getPlayerNumber()
        Returns the player number of the entry. Will be 0 if no player was passed.
        Returns:
        The player number of the entry
      • isValidRound

        public boolean isValidRound()
        Returns flag telling if it was a valid round.
        Returns:
        true if round was valid, else false
      • getAsString

        public java.lang.String getAsString()
        Gets the entry as a string. Adds the round number into the GameLogEntry.RoundTitle when it's a valid round. Converts the player number to [Player X] if a player number was set.
        Returns:
        The entry as a string in format <Title> [Player]: <Message>
      • toString

        public java.lang.String toString()
        Returns the entry as a string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The entry as a string
        See Also:
        getAsString()