Class GameEngine

Implements

Constructors

Properties

game: Game

Methods

  • Adds a new player to the game.

    This is only allowed before the game is started.

    Parameters

    • id: string

    Returns void

    Throws

    AlreadyStartedGameError

    Throws

    AlreadyExistsPlayerError

    Throws

    PlayersMaximumReachedError

  • Allows the Assassin to assassinate the already chosen victim.

    Parameters

    • assassinsId: string

    Returns void

    Throws

    NoTimeForAssassinationError

    Throws

    DeniedAssassinationError

    Throws

    RequiredVictimError

  • Removes a player from the game.

    This is only allowed before the game is started.

    Parameters

    • id: string

    Returns void

    Throws

    AlreadyStartedGameError

  • Allows a current team leader to un-propose every player

    Parameters

    • leaderId: string

    Returns void

    Throws

    NoTimeForTeammatePropositionError

    Throws

    DeniedTeammatePropositionError

  • Starts a game.

    There should be enough players.

    Parameters

    Returns void

    Throws

    AlreadyStartedGameError

    Throws

    PlayersAmountIncorrectError

  • Finalizes a team proposition by the current leader. This allows all the players to either decline or approve the proposed team by the means of voting.

    Parameters

    • leaderId: string

    Returns void

    Throws

    NoTimeForTeamSubmissionError

    Throws

    NoTimeForTeammatePropositionError

    Throws

    DeniedTeamSubmissionError

    Throws

    RequiredCorrectTeammatesAmountError

  • Allows a current team leader to propose / un-proposes a player to join a team for the current quest.

    Parameters

    • leaderId: string
    • id: string

    Returns void

    Throws

    NoTimeForTeammatePropositionError

    Throws

    DeniedTeammatePropositionError

  • Allows the Assassin to choose a possible victim during the assassination phase.

    Parameters

    • assassinsId: string
    • victimsId: string

    Returns void

    Throws

    NoTimeVictimPropositionError

    Throws

    DeniedVictimPropositionError

    Throws

    DeniedSelfSacrificeError

  • Allows a team member to vote whether the quest was successful or not.

    Parameters

    • id: string
    • voteValue: boolean

    Returns void

    Throws

    NoTimeForQuestVotingError

    Throws

    DeniedQuestVotingError

    Throws

    PlayerMissingError

    Throws

    AlreadyVotedError

  • Allows a player to either approve or reject the currently proposed team.

    Parameters

    • id: string
    • voteValue: boolean

    Returns void

    Throws

    NoTimeForTeamVotingError

    Throws

    DeniedTeamVotingError

    Throws

    PlayerMissingError

    Throws

    AlreadyVotedError

Generated using TypeDoc