Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ReactorSystem<RoomType>

Represents a system responsible for handling reactor consoles.

See ReactorSystemEvents 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<RoomType>, rpc: undefined | RepairSystemMessage): Promise<void>

Serialize

addConsole

  • addConsole(consoleId: number): Promise<void>
  • Add a completed console. (Same as a player placing their hand on a console)

    Parameters

    • consoleId: number

      The ID of the console 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>[]

off

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

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset"

    Parameters

    Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns void

on

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

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset"

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

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset"

    Parameters

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

removeAllListeners

  • removeAllListeners(): void

removeConsole

  • removeConsole(consoleId: number): Promise<void>
  • Remove a completed console. (Same as a player removing their hand from a console)

    Parameters

    • consoleId: number

      The ID of the console to add.

    Returns Promise<void>

removeListeners

  • removeListeners(event: string): void

repair

  • repair(): Promise<void>

sabotage

  • sabotage(): Promise<void>

wait

  • Type parameters

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset"

    Parameters

    • event: EventName

    Returns Promise<ReactorSystemEvents<Hostable<any>>[EventName]>

  • Parameters

    • event: string

    Returns Promise<BasicEvent>

waitf

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

    • EventName: "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset"

    Parameters

    Returns Promise<ReactorSystemEvents<Hostable<any>>[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

completed

completed: Set<number>

The completed consoles.

systemType

systemType: SystemType

timer

timer: number

The timer before the reactor explodes.

Constructors

constructor

Accessors

dirty

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

room

  • get room(): RoomType

sabotaged

  • get sabotaged(): boolean

Generated using TypeDoc