Class SetBuildQueueMessage


  • public class SetBuildQueueMessage
    extends AttributeMessage
    The message sent when setting the build queue.
    • Constructor Detail

      • SetBuildQueueMessage

        public SetBuildQueueMessage​(Colony colony,
                                    java.util.List<BuildableType> queue)
        Create a new SetBuildQueueMessage for the supplied colony and queue.
        Parameters:
        colony - The Colony where the queue is.
        queue - A list of BuildableTypes to build.
      • SetBuildQueueMessage

        public SetBuildQueueMessage​(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 - is the stream is corrupt.
    • Method Detail

      • getAttributeMap

        private static java.util.Map<java.lang.String,​java.lang.String> getAttributeMap​(FreeColXMLReader xr)
        Get a map of attributes from the reader.
        Parameters:
        xr - The FreeColXMLReader to query.
        Returns:
        A map of attributes.
      • getColony

        private Colony getColony​(Player player)
        Get the colony that is building.
        Parameters:
        player - The Player that owns the colony.
        Returns:
        The colony.
      • getQueue

        private java.util.List<BuildableType> getQueue​(Specification spec)
        Get the list of buildables defined by the array attributes.
        Parameters:
        spec - A Specification to use to make the buildable.
        Returns:
        A list of BuildableTypes.
      • currentPlayerMessage

        public boolean currentPlayerMessage()
        Should this message only be sent to a server by the current player?
        Overrides:
        currentPlayerMessage in class TrivialMessage
        Returns:
        True if this is a current-player-only 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.