Class UpdateTradeRouteMessage


  • public class UpdateTradeRouteMessage
    extends ObjectMessage
    The message sent when updating a trade route.
    • Constructor Detail

      • UpdateTradeRouteMessage

        public UpdateTradeRouteMessage​(TradeRoute tradeRoute)
        Create a new UpdateTradeRouteMessage with the supplied trade route.
        Parameters:
        tradeRoute - The TradeRoute to update.
      • UpdateTradeRouteMessage

        public UpdateTradeRouteMessage​(Game game,
                                       FreeColXMLReader xr)
                                throws javax.xml.stream.XMLStreamException
        Create a new UpdateTradeRouteMessage 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

      • getTradeRoute

        private TradeRoute getTradeRoute()
        Accessor for the trade route.
        Returns:
        The attached TradeRoute.
      • 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.