@andreabiagini5/applicazioni-e-servizi-web-project - v1.1.3
    Preparing search index...

    Interface Match

    Aggregate root representing a match, containing two players and the corresponding board.

    interface Match {
        creationDate: Date;
        initialState: Board;
        moves: Move[];
        player1: string;
        player2: string;
        ratingDelta: number;
        winner: string;
        addMove(newMove: Move): boolean;
        computeCurrentState(): Board;
    }
    Index

    Properties

    creationDate: Date

    The match creation date.

    initialState: Board

    The initial state of the board.

    moves: Move[]

    The list of the moves performed by the players. Moves owners alternates starting from player1.

    player1: string

    The first player (who has the first turn).

    player2: string

    The second player.

    ratingDelta: number

    The score delta that the winner has earned and the looser has lost on match ending.

    winner: string

    The winner of the match. It is null when the match is not finished.

    Methods

    • Adds a new move to the moves list, checking if it is possible.

      Parameters

      • newMove: Move

        the move to be added.

      Returns boolean

      true if the move had effect, false otherwise.