Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SecurityCameraSystem<RoomType>

Represents a system responsible for handling players entering and leaving security cameras.

See SecurityCameraSystemEvents for events to listen to.

Type parameters

  • RoomType: Hostable

Hierarchy

Implements

Index

Methods

Deserialize

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

Detoriorate

  • Detoriorate(delta: number): void

HandleRepair

  • HandleRepair(player: undefined | PlayerData<RoomType>, amount: number, rpc: undefined | RepairSystemMessage): Promise<void>

HandleSabotage

  • HandleSabotage(player: undefined | PlayerData<Hostable<any>>, rpc: undefined | RepairSystemMessage): Promise<void>

Serialize

addPlayer

  • addPlayer(player: PlayerData<Hostable<any>>): Promise<void>
  • Add a player to the security cameras.

    example
    security.addPlayer(client.me);
    

    Parameters

    • player: PlayerData<Hostable<any>>

      The player to add.

    Returns Promise<void>

emit

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

emitSerial

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

emitSync

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

getListeners

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

join

  • join(): Promise<void>

leave

  • leave(): Promise<void>

off

  • off<EventName>(event: EventName, listener: Listener<SecurityCameraSystemEvents<Hostable<any>>[EventName]>): void
  • off<K>(event: string, listener: Listener<K>): void
  • Type parameters

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "security.cameras.join" | "security.cameras.leave"

    Parameters

    Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns void

on

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

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "security.cameras.join" | "security.cameras.leave"

    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<SecurityCameraSystemEvents<Hostable<any>>[EventName]>): () => void
  • once<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "security.cameras.join" | "security.cameras.leave"

    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

removePlayer

  • removePlayer(player: PlayerData<Hostable<any>>): Promise<void>
  • Remove a player from the security cameras.

    example
    security.removePlayer(client.me);
    

    Parameters

    • player: PlayerData<Hostable<any>>

      The player to remove.

    Returns Promise<void>

repair

  • repair(): Promise<void>

sabotage

  • sabotage(): Promise<void>

wait

waitf

Constructors

constructor

Accessors

dirty

  • get dirty(): boolean
  • set dirty(isDirty: boolean): void

room

  • get room(): RoomType

sabotaged

  • get sabotaged(): boolean

Properties

players

players: Set<PlayerData<Hostable<any>>>

The players currently looking at cameras.

systemType

systemType: SystemType

Generated using TypeDoc