Skip to content

ProcessSlot

Defined in: ProcessSlot.ts:24

A reusable, restartable process handle owned by a ProcessComponent.

Starts in completed state (ready to use). Call start() to activate. Use for cooldowns, invincibility windows, flash effects, shakes, etc.

new ProcessSlot(config?): ProcessSlot

Defined in: ProcessSlot.ts:33

ProcessSlotConfig = {}

ProcessSlot

readonly tags: readonly string[]

Defined in: ProcessSlot.ts:31

Tags for filtering/grouping.

get completed(): boolean

Defined in: ProcessSlot.ts:39

Whether the slot has completed (starts true).

boolean


get elapsed(): number

Defined in: ProcessSlot.ts:49

Milliseconds elapsed since start.

number


get ratio(): number

Defined in: ProcessSlot.ts:54

Progress ratio 0..1 (elapsed / duration). 0 if no duration set.

number


get running(): boolean

Defined in: ProcessSlot.ts:44

Whether the slot is actively running (not completed and not paused).

boolean

_tick(dt): void

Defined in: ProcessSlot.ts:113

Internal

Advance the slot by dt milliseconds. — called by ProcessComponent

number

void


cancel(): void

Defined in: ProcessSlot.ts:87

Cancel the slot. Calls cleanup if running.

void


onComplete(fn): this

Defined in: ProcessSlot.ts:104

Set/override the onComplete callback. Chainable.

() => void

this


pause(): void

Defined in: ProcessSlot.ts:94

Pause the slot.

void


restart(overrides?): this

Defined in: ProcessSlot.ts:76

Cancel if running, then start fresh. Always restarts.

Partial<ProcessSlotConfig>

this


resume(): void

Defined in: ProcessSlot.ts:99

Resume the slot.

void


start(overrides?): this

Defined in: ProcessSlot.ts:61

Start the slot. No-op if already running (use restart() to force).

Partial<ProcessSlotConfig>

this