skeldjs
    Preparing search index...

    Class NormalRoleSelectionLogicComponent<RoomType>

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    isDirty: boolean
    specialCrewmateRoles: typeof GuardianAngelRole[] = ...

    Methods

    • Assign a list of roles to a pool of players, eliminating both players from the player list and also roles from the role list, and without regard for room settings (i.e. the chances of each role appearing or the maximum number of assignments for the role).

      Parameters

      • playerPool: Player<RoomType>[]

        The pool of players to assign a list of roles to.

      • maxAssignable: number

        The maximum number of players that cn be assigned a role from this list.

      • roleList: typeof BaseRole[]

        The list of roles to assign to players.

      • roleAssignments: Map<Player<RoomType>, typeof BaseRole> = ...

        A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

      Returns Map<Player<RoomType>, typeof BaseRole>

      The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.

    • Specifically assign a pool of players to each role in a specific team.

      Parameters

      • playerPool: Player<RoomType>[]

        The entire list of players that can be assigned a role, whether or not they already have a role. Note that this is not a list of players to be assigned a role from this team, but it is instead every possible player who could be assigned one.

      • settings: Partial<Record<RoleType, RoleChanceSettings>>

        Role settings to use when calculating how many players should assigned a specific role.

      • roleTeam: RoleTeamType

        The team of roles to assign.

      • maxAssignable: number

        The maximum number of players that can be assigned a role from this team. For example, it could be the set number of impostors configured in the game settings.

      • OptionaldefaultRole: typeof BaseRole

        The default role to assign to each player

      • roleAssignments: Map<Player<RoomType>, typeof BaseRole> = ...

        A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

      Returns void

      The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.

    • Specifically assign a pool of players to each role in a list, with regard to the room settings (i.e. the chance of each role appearing or the maximum number of assignments for the role).

      Parameters

      • playerPool: Player<RoomType>[]

        The entire list of players that can be assigned a role, whether or not they already have a role. Note that this is not a list of players to be assigned a role from this team, but it is instead every possible player who could be assigned one.

      • settings: Partial<Record<RoleType, RoleChanceSettings>>

        Role settings to use when calculating how many players should assigned a specific role.

      • teamRoles: typeof BaseRole[]
      • maxAssignable: number

        The maximum number of players that can be assigned a role from this team. For example, it could be the set number of impostors configured in the game settings.

      • OptionaldefaultRole: typeof BaseRole

        The default role to assign to each player

      • roleAssignments: Map<Player<RoomType>, typeof BaseRole> = ...

        A map of role assigments (i.e. a map of player to roles) to act as a collective output to this method.

      Returns void

      The role assignments (i.e. a map of player to roles) that have either collectively been assigned (if roleAssignments is passed) or been assigned just as part of this method.