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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProcessSlot(
config?):ProcessSlot
Defined in: ProcessSlot.ts:33
Parameters
Section titled “Parameters”config?
Section titled “config?”ProcessSlotConfig = {}
Returns
Section titled “Returns”ProcessSlot
Properties
Section titled “Properties”
readonlytags: readonlystring[]
Defined in: ProcessSlot.ts:31
Tags for filtering/grouping.
Accessors
Section titled “Accessors”completed
Section titled “completed”Get Signature
Section titled “Get Signature”get completed():
boolean
Defined in: ProcessSlot.ts:39
Whether the slot has completed (starts true).
Returns
Section titled “Returns”boolean
elapsed
Section titled “elapsed”Get Signature
Section titled “Get Signature”get elapsed():
number
Defined in: ProcessSlot.ts:49
Milliseconds elapsed since start.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get ratio():
number
Defined in: ProcessSlot.ts:54
Progress ratio 0..1 (elapsed / duration). 0 if no duration set.
Returns
Section titled “Returns”number
running
Section titled “running”Get Signature
Section titled “Get Signature”get running():
boolean
Defined in: ProcessSlot.ts:44
Whether the slot is actively running (not completed and not paused).
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”_tick()
Section titled “_tick()”_tick(
dt):void
Defined in: ProcessSlot.ts:113
Internal
Advance the slot by dt milliseconds. — called by ProcessComponent
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
cancel()
Section titled “cancel()”cancel():
void
Defined in: ProcessSlot.ts:87
Cancel the slot. Calls cleanup if running.
Returns
Section titled “Returns”void
onComplete()
Section titled “onComplete()”onComplete(
fn):this
Defined in: ProcessSlot.ts:104
Set/override the onComplete callback. Chainable.
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”this
pause()
Section titled “pause()”pause():
void
Defined in: ProcessSlot.ts:94
Pause the slot.
Returns
Section titled “Returns”void
restart()
Section titled “restart()”restart(
overrides?):this
Defined in: ProcessSlot.ts:76
Cancel if running, then start fresh. Always restarts.
Parameters
Section titled “Parameters”overrides?
Section titled “overrides?”Partial<ProcessSlotConfig>
Returns
Section titled “Returns”this
resume()
Section titled “resume()”resume():
void
Defined in: ProcessSlot.ts:99
Resume the slot.
Returns
Section titled “Returns”void
start()
Section titled “start()”start(
overrides?):this
Defined in: ProcessSlot.ts:61
Start the slot. No-op if already running (use restart() to force).
Parameters
Section titled “Parameters”overrides?
Section titled “overrides?”Partial<ProcessSlotConfig>
Returns
Section titled “Returns”this