Skip to main content

Class: CompositeLogicXMLHost

Constructors

constructor

new CompositeLogicXMLHost(startPaused?): CompositeLogicXMLHost

Ctor

Parameters

NameTypeDefault valueDescription
startPausedbooleanfalseTrue to start paused.

Returns

CompositeLogicXMLHost

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:44

Methods

addFunction

addFunction(funcSpec): string | number

Add a function to the logic context.

Parameters

NameTypeDescription
funcSpecXMLFunctionThe XMLFunction configuration.

Returns

string | number

The function's current value.

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:96


addLogic

addLogic(logic, handler): string | number

Add a new logic element to calcluate a number or a string.

Parameters

NameTypeDescription
logicCompositeLogicXMLElementA CompositeLogicXMLElement.
handler(data: string | number) => voidA callback hander to take new values of either type.

Returns

string | number

The current value of the logic.

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:62


addLogicAsNumber

addLogicAsNumber(logic, handler, precision, smoothFactor?): number

Add a new logic element to calcluate a number.

Parameters

NameTypeDescription
logicCompositeLogicXMLElementA CompositeLogicXMLElement.
handler(data: number) => voidA callback hander to take new values as numbers.
precisionnumberAn optional precision to require for updates to be sent.
smoothFactor?numberAn optional linear smoothing factor to apply to the value when updating.

Returns

number

The current value of the logic.

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:75


addLogicAsString

addLogicAsString(logic, handler): string

Add a new logic element to calcluate a string.

Parameters

NameTypeDescription
logicCompositeLogicXMLElementA CompositeLogicXMLElement.
handler(data: string) => voidA callback hander to take new values as strings.

Returns

string

The current value of the logic.

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:86


setIsPaused

setIsPaused(isPaused): void

Set to pause the logic update loop.

Parameters

NameTypeDescription
isPausedbooleanTrue to pause, false to resume.

Returns

void

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:52


update

update(deltaTime): void

Update every logic element and publish updates.

Parameters

NameTypeDescription
deltaTimenumberThe time since the last update, in ms.

Returns

void

Defined in

src/sdk/data/CompositeLogicXMLHost.ts:108