Class GameEndedMessage


  • public class GameEndedMessage
    extends AttributeMessage
    The message to signal the end of the game.
    • Constructor Detail

      • GameEndedMessage

        public GameEndedMessage​(Player winner,
                                boolean highScore)
        Create a new GameEndedMessage with the supplied winner.
        Parameters:
        winner - The Player that has won.
        highScore - True if a new high score was reached.
      • GameEndedMessage

        public GameEndedMessage​(Game game,
                                FreeColXMLReader xr)
                         throws javax.xml.stream.XMLStreamException
        Create a new GameEndedMessage from a stream.
        Parameters:
        game - The Game this message belongs to.
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if the stream is corrupt.
    • Method Detail

      • aiHandler

        public void aiHandler​(FreeColServer freeColServer,
                              AIPlayer aiPlayer)
        AI-side handler for this message. AI handlers always return null. FIXME: One day the FreeColServer should devolve to AIMain.
        Overrides:
        aiHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        aiPlayer - The AIPlayer the message was sent to.
      • clientHandler

        public void clientHandler​(FreeColClient freeColClient)
        Client-side handler for this message. Client handlers always return null.
        Overrides:
        clientHandler in class TrivialMessage
        Parameters:
        freeColClient - The FreeColClient to handle this message.
      • getWinner

        public Player getWinner​(Game game)
        Who won?
        Parameters:
        game - The Game the winner is in.
        Returns:
        The Player that won.
      • getScore

        public java.lang.String getScore()
        Get the high score attribute. Note: *not* a boolean, due to a kludge in client.IGIH.
        Returns:
        The score attribute.