# Class FlightPhaseCommand

java.lang.Object
it.polimi.ingsw.is25am31.network.socket.serverClientMessages.FlightPhaseCommand

All Implemented Interfaces:
  `ServerClientCommand`, `Serializable`

public class FlightPhaseCommand extends Object implements ServerClientCommand, Serializable
Represents a command sent from the server to the client to start the flight phase of the game.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FlightPhaseCommand(Ship ship, Map<Integer,Integer> positions)`
  Constructs a new `FlightPhaseCommand`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `execute(SocketClient client)`
  Executes the command on the `SocketClient`, instructing it to start the flight phase with the provided ship and position information.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FlightPhaseCommand

    public FlightPhaseCommand(Ship ship, Map<Integer,Integer> positions)
    Constructs a new `FlightPhaseCommand`.
    Parameters:
      `ship` - The `Ship` object representing the current state of the player's ship.
      `positions` - A `Map` with as keys the players' ids and as values their updated positions on the game board.

- ## Method Details

  - ### execute

    public void execute(SocketClient client) throws Exception
    Executes the command on the `SocketClient`, instructing it to start the flight phase with the provided ship and position information.
    Specified by:
      `execute` in interface `ServerClientCommand`
    Parameters:
      `client` - The `SocketClient` instance on which the command will be executed.
    Throws:
      `Exception` - if an error occurs during the flight phase on the client.