Class RoomAssignRolesEvent<RoomType>

Emitted when SkeldJS assigns roles to each player, just after a game is started. Can be canceled to avoid assigning roles entirely, or can be used to change which roles are assigned to which players.

Does not guarantee that the players' roles have actually been assigned, see PlayerSetRoleEvent.

Type Parameters

Hierarchy

  • CancelableEvent
    • RoomAssignRolesEvent

Implements

Properties

eventName: "room.assignroles"
canceled: boolean
eventName: "room.assignroles"
roleAssignments: Map<PlayerData<RoomType>, typeof BaseRole>

The players that were chosen to be impostors.

room: RoomType

The room or client that the event came from.

Accessors

  • get alteredAssignments(): Map<PlayerData<RoomType>, typeof BaseRole>
  • Which roles to assign to which players instead, if changed.

    Returns Map<PlayerData<RoomType>, typeof BaseRole>

Methods

  • Returns void

  • Change which role a player will get assigned.

    Parameters

    • player: PlayerData<RoomType>

      The player to change the assignment for.

    • assignment: typeof BaseRole

      The role to assign for the player instead.

    Returns void

  • Change which roles to assign to which players.

    Parameters

    • roleAssignments: Map<PlayerData<RoomType>, typeof BaseRole>

      The roles to assign instead.

    Returns void

Constructors

  • Type Parameters

    Parameters

    • room: RoomType
    • roleAssignments: Map<PlayerData<RoomType>, typeof BaseRole>

      The players that were chosen to be impostors.

    Returns RoomAssignRolesEvent<RoomType>

Generated using TypeDoc