Class SetColorMessage


  • public class SetColorMessage
    extends AttributeMessage
    The message that changes the player color.
    • Constructor Detail

      • SetColorMessage

        public SetColorMessage​(Nation nation,
                               java.awt.Color color)
        Create a new SetColorMessage.
        Parameters:
        nation - The Nation that is changing color.
        color - The new Color.
      • SetColorMessage

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

      • 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.
      • getNation

        public Nation getNation​(Specification spec)
        Get the nation whose color is changing.
        Parameters:
        spec - The Specification to look up the nation in.
        Returns:
        The Nation.
      • getColor

        public java.awt.Color getColor()
        Get the color.
        Returns:
        The new Color.