Interface CurrentPlayerValidation

Interface representing the validation logic for a player in a game. This validation determines, if user is allowed to make a move for player in the game.

interface CurrentPlayerValidation {
    canMoveAsPlayer(id: number): boolean;
    isServerOriginating(): boolean;
    isUser(id: string, name: string): boolean;
}

Methods

  • Determines if the user sending the action occupies the seat with given id.

    Parameters

    • id: number

      The numeric ID of the player.

    Returns boolean

    A boolean indicating whether the player can move.

  • Determines if the action or request originates from the server.

    Returns boolean

    A boolean indicating whether the origin is the server.

  • Checks if the provided ID and name match the user sending the action.

    Parameters

    • id: string

      The string ID of the user.

    • name: string

      The name of the user.

    Returns boolean

    A boolean indicating whether the ID and name correspond to the current user.