Class HighScoresMessage


  • public class HighScoresMessage
    extends ObjectMessage
    The message sent when an high score query/response occurs.
    • Constructor Detail

      • HighScoresMessage

        public HighScoresMessage​(java.lang.String key,
                                 java.util.List<HighScore> scores)
        Create a new HighScoresMessage in request form (no scores attached).
        Parameters:
        key - A message key for the final display.
        scores - The list of high scores, or null.
      • HighScoresMessage

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

      • getKey

        private java.lang.String getKey()
        Accessor for the key.
        Returns:
        The key.
      • getScores

        private java.util.List<HighScore> getScores()
        Accessor for the scores list.
        Returns:
        The list of HighScores.
      • 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.
      • serverHandler

        public ChangeSet serverHandler​(FreeColServer freeColServer,
                                       ServerPlayer serverPlayer)
        Server-side handler for this message.
        Overrides:
        serverHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        serverPlayer - The ServerPlayer that sent the request.
        Returns:
        A ChangeSet defining the response.