# Class AbandonRaceCommand

java.lang.Object
it.polimi.ingsw.is25am31.network.socket.clientServerMessages.AbandonRaceCommand

All Implemented Interfaces:
  `ClientServerCommand`, `Serializable`

public class AbandonRaceCommand extends Object implements ClientServerCommand, Serializable
Represents a command sent from the client to the server to abandon the race. This command is serializable and can be transmitted over a network.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbandonRaceCommand(UUID clientId)`
  Constructs an `AbandonRaceCommand` with the specified client ID.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `execute(SocketServer server)`
  Executes the abandon race action on the provided `SocketServer`.

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

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

- ## Constructor Details

  - ### AbandonRaceCommand

    public AbandonRaceCommand(UUID clientId)
    Constructs an `AbandonRaceCommand` with the specified client ID.
    Parameters:
      `clientId` - The unique identifier of the client abandoning the race.

- ## Method Details

  - ### execute

    public void execute(SocketServer server) throws Exception
    Executes the abandon race action on the provided `SocketServer`. This method calls the `abandonRace` method of the server, passing the client's UUID.
    Specified by:
      `execute` in interface `ClientServerCommand`
    Parameters:
      `server` - The `SocketServer` instance on which the command will be executed.
    Throws:
      `Exception` - if an error occurs during the execution on the server.