Options
All
  • Public
  • Public/Protected
  • All
Menu

A helper class which manages the refresh workflow for perception layers on the canvas. This controls the logic which batches multiple requested updates to minimize the amount of work required. A singleton instance is available as canvas#perception.

see

{Canvas#perception}

Hierarchy

  • PerceptionManager

Index

Constructors

Methods

  • activate(): void
  • Activate perception management by registering the update function to the Ticker.

    Returns void

  • deactivate(): void
  • Deactivate perception management by un-registering the update function from the Ticker.

    Returns void

  • update(flags: any, v2?: boolean): void
  • Update perception manager flags which configure which behaviors occur on the next frame render.

    Parameters

    • flags: any

      Flag values (true) to assign where the keys belong to PerceptionManager.FLAGS

    • v2: boolean = false

    Returns void

  • initialize(): void
  • A helper function to perform an immediate initialization plus incremental refresh.

    Returns void

  • refresh(): void
  • A helper function to perform an incremental refresh only.

    Returns void

  • #update(): void
  • Perform the perception update workflow.

    Returns void

  • #reset(): void
  • Reset the values of a pending refresh back to their default states.

    Returns void

  • #getFlags(): any
  • Construct the data structure of boolean flags which are supported by the Perception Manager.

    Returns any

Properties

#changed: boolean = false

A top-level boolean which records whether any flag has changed.

#flags: any = ...

Flags which are scheduled to be enacted with the next frame.

FLAGS: { initializeLighting: { propagate: string[]; reset: any[] }; refreshLighting: { propagate: string[]; reset: any[] }; refreshLightSources: { propagate: any[]; reset: any[] }; refreshVisionSources: { propagate: any[]; reset: any[] }; refreshPrimary: { propagate: any[]; reset: any[] }; initializeVision: { propagate: string[]; reset: any[] }; refreshVision: { propagate: string[]; reset: any[] }; initializeSounds: { propagate: string[]; reset: any[] }; refreshSounds: { propagate: any[]; reset: any[] }; refreshTiles: { propagate: string[]; reset: any[] }; soundFadeDuration: { propagate: any[]; reset: any[] }; forceUpdateFog: { propagate: any[]; reset: any[] } } = ...

The set of state flags which are supported by the Perception Manager. When a refresh occurs, operations associated with each true flag are executed and the state is reset.

Type declaration

  • initializeLighting: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • refreshLighting: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • refreshLightSources: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
  • refreshVisionSources: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
  • refreshPrimary: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
  • initializeVision: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • refreshVision: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • initializeSounds: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • refreshSounds: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
  • refreshTiles: { propagate: string[]; reset: any[] }
    • propagate: string[]
    • reset: any[]
  • soundFadeDuration: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
  • forceUpdateFog: { propagate: any[]; reset: any[] }
    • propagate: any[]
    • reset: any[]
COMPATIBILITY_MAPPING: { lighting.initialize: string; lighting.refresh: string; sight.initialize: string; sight.refresh: string; sight.forceUpdateFog: string; sounds.initialize: string; sounds.refresh: string; sounds.fade: string; foreground.refresh: string } = ...

A shim mapping which supports backwards compatibility for old-style (V9 and before) perception manager flags.

Type declaration

  • lighting.initialize: string
  • lighting.refresh: string
  • sight.initialize: string
  • sight.refresh: string
  • sight.forceUpdateFog: string
  • sounds.initialize: string
  • sounds.refresh: string
  • sounds.fade: string
  • foreground.refresh: string