Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • RoomType: Hostable

Hierarchy

Implements

Index

Properties

Static eventName

eventName: "room.assignroles" = ...

canceled

canceled: boolean

eventName

eventName: "room.assignroles" = ...

Readonly roleAssignments

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

Readonly room

room: RoomType

The room or client that the event came from.

Accessors

alteredAssignments

  • get alteredAssignments(): Map<PlayerData<RoomType>, typeof BaseRole>

Methods

cancel

  • cancel(): void

setAssignment

  • setAssignment(player: PlayerData<RoomType>, assignment: typeof BaseRole): 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

setAssignments

  • setAssignments(roleAssignments: Map<PlayerData<RoomType>, typeof BaseRole>): void

Constructors

constructor

  • new RoomAssignRolesEvent<RoomType>(room: RoomType, roleAssignments: Map<PlayerData<RoomType>, typeof BaseRole>): RoomAssignRolesEvent<RoomType>

Generated using TypeDoc