Class AnimateMoveMessage


  • public class AnimateMoveMessage
    extends ObjectMessage
    The message sent to tell a client to show a movement animation.
    • Constructor Detail

      • AnimateMoveMessage

        public AnimateMoveMessage​(Unit unit,
                                  Tile oldTile,
                                  Tile newTile,
                                  boolean appears)
        Create a new AnimateMoveMessage for the supplied unit and direction.
        Parameters:
        unit - The Unit to move.
        oldTile - The Tile to move from.
        newTile - The Tile to move to.
        appears - If true, the unit is newly appearing, and either it or its carrier must be present in this message.
      • AnimateMoveMessage

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

      • getUnit

        private Unit getUnit​(Game game)
        Get the unit that is moving.
        Parameters:
        game - The Game to look up the unit in.
        Returns:
        The Unit that moves.
      • getNewTile

        private Tile getNewTile​(Game game)
        Get the tile to move to.
        Parameters:
        game - The Game to look up the tile in.
        Returns:
        The new Tile.
      • getOldTile

        private Tile getOldTile​(Game game)
        Get the tile to move from.
        Parameters:
        game - The Game to look up the tile in.
        Returns:
        The old Tile.
      • 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.