Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeetingHud<RoomType>

Type parameters

  • RoomType: Hostable

Hierarchy

Implements

Index

Methods

Awake

  • Awake(): void

Deserialize

  • Deserialize(reader: HazelReader, spawn?: boolean): void

Destroy

  • Destroy(): void

FixedUpdate

  • FixedUpdate(delta: number): void

HandleRpc

PreSerialize

  • PreSerialize(): void

Serialize

  • Serialize(writer: HazelWriter, spawn?: boolean): boolean

canBeManaged

  • canBeManaged(): boolean

castVote

  • castVote(voter: PlayerDataResolvable, suspect: PlayerDataResolvable | "skip"): Promise<void>
  • Cast a vote on behalf of a user (or yourself). Casting for another player other than the player calling the function is a host-only operation on official servers.

    example
    // Make everyone vote a certain player.
    for ([ clientId, player ] of room.players) {
      if (player !== suspect) {
        room.meetinghud.castVote(player, suspect);
      }
    }
    

    Parameters

    • voter: PlayerDataResolvable

      The player who is voting.

    • suspect: PlayerDataResolvable | "skip"

      The player to vote for.

    Returns Promise<void>

checkForVoteComplete

  • checkForVoteComplete(isTimeout: boolean): void

clearVote

  • clearVote(voter: PlayerDataResolvable): Promise<void>
  • Remove someone's vote (usually due to the player they voted for getting disconnected). This is a host-only operation on official servers.

    Parameters

    • voter: PlayerDataResolvable

    Returns Promise<void>

close

  • close(): void

despawn

  • despawn(): void
  • Despawns the component from the room it belongs in.

    Returns void

emit

  • emit<Event>(event: Event): Promise<Event>

emitSerial

  • emitSerial<Event>(event: Event): Promise<Event>

emitSync

  • emitSync<Event>(event: Event): Event

getComponent

  • getComponent<T>(component: NetworkableConstructor<T>): undefined | T
  • Type parameters

    • T: Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>, T>

    Parameters

    • component: NetworkableConstructor<T>

    Returns undefined | T

getListeners

  • getListeners<Event>(event: string): Listener<Event>[]

off

  • off<EventName>(event: EventName, listener: Listener<MeetingHudEvents<RoomType>[EventName]>): void
  • off<K>(event: string, listener: Listener<K>): void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close"

    Parameters

    Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns void

on

  • on<EventName>(event: EventName, listener: Listener<MeetingHudEvents<RoomType>[EventName]>): () => void
  • on<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close"

    Parameters

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

once

  • once<EventName>(event: EventName, listener: Listener<MeetingHudEvents<RoomType>[EventName]>): () => void
  • once<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close"

    Parameters

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

removeAllListeners

  • removeAllListeners(): void

removeListeners

  • removeListeners(event: string): void

spawn

  • spawn(): void
  • Spawn this component if does not exist in the room it belongs in.

    Returns void

votingComplete

  • votingComplete(tie?: boolean, exiled?: PlayerDataResolvable): Promise<void>
  • End the meeting with specified results. This is a host-only operation on official servers.

    Parameters

    • tie: boolean = false

      Whether this meeting resulted in a tie of votes.

    • Optional exiled: PlayerDataResolvable

      The player that was ejected, if any.

    Returns Promise<void>

wait

  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close"

    Parameters

    • event: EventName

    Returns Promise<MeetingHudEvents<RoomType>[EventName]>

  • Parameters

    • event: string

    Returns Promise<BasicEvent>

waitf

  • waitf<EventName>(event: EventName, filter: (ev: MeetingHudEvents<RoomType>[EventName]) => boolean | Promise<boolean>): Promise<MeetingHudEvents<RoomType>[EventName]>
  • waitf<K>(event: string, filter: (ev: K) => boolean | Promise<boolean>): Promise<BasicEvent>
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close"

    Parameters

    • event: EventName
    • filter: (ev: MeetingHudEvents<RoomType>[EventName]) => boolean | Promise<boolean>
        • Parameters

          Returns boolean | Promise<boolean>

    Returns Promise<MeetingHudEvents<RoomType>[EventName]>

  • Type parameters

    Parameters

    • event: string
    • filter: (ev: K) => boolean | Promise<boolean>
        • (ev: K): boolean | Promise<boolean>
        • Parameters

          • ev: K

          Returns boolean | Promise<boolean>

    Returns Promise<BasicEvent>

Properties

components

components: Networkable<any, NetworkableEvents<Hostable<any>>, RoomType>[]

dirtyBit

dirtyBit: number

The dirty vote states to be updated on the next fixed update.

Optional exiled

exiled: PlayerData<RoomType>

The player that was exiled, if any.

flags

flags: number

Flags for this object, see SpawnFlag.

netId

netId: number

The net ID of this component.

ownerId

ownerId: number

The ID of the owner of this component.

Optional player

player: PlayerData<RoomType>

The player that this component belongs to.

Optional ranOutOfTimeTimeout

ranOutOfTimeTimeout: Timeout

room

room: RoomType

The room that this component belongs to.

spawnType

spawnType: SpawnType

The type of object that this component belongs to.

Optional tie

tie: boolean

Whether the vote resulted in a tie.

voteStates

voteStates: Map<number, PlayerVoteArea<RoomType>>

The vote states in the meeting hud.

Constructors

constructor

Accessors

owner

  • get owner(): RoomType

Generated using TypeDoc