Class NewTurnMessage


  • public class NewTurnMessage
    extends AttributeMessage
    The message sent to the clients to signal a new turn.
    • Constructor Detail

      • NewTurnMessage

        public NewTurnMessage​(Turn turn)
        Create a new NewTurnMessage with the supplied message.
        Parameters:
        turn - The new Turn.
      • NewTurnMessage

        public NewTurnMessage​(Game game,
                              FreeColXMLReader xr)
                       throws javax.xml.stream.XMLStreamException
        Create a new NewTurnMessage from a stream.
        Parameters:
        game - The Game to read within.
        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.
      • getTurnNumber

        public int getTurnNumber()
        Get the turn number.
        Returns:
        The turn number.