Class: CompositeLogicXMLHost
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:27
Constructors
Constructor
new CompositeLogicXMLHost(
startPaused
):CompositeLogicXMLHost
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:44
Ctor
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
startPaused | boolean | false | True to start paused. |
Returns
CompositeLogicXMLHost
Methods
addFunction()
addFunction(
funcSpec
):string
|number
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:96
Add a function to the logic context.
Parameters
Parameter | Type | Description |
---|---|---|
funcSpec | XMLFunction | The XMLFunction configuration. |
Returns
string
| number
The function's current value.
addLogic()
addLogic(
logic
,handler
):string
|number
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:62
Add a new logic element to calcluate a number or a string.
Parameters
Parameter | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data ) => void | A callback hander to take new values of either type. |
Returns
string
| number
The current value of the logic.
addLogicAsNumber()
addLogicAsNumber(
logic
,handler
,precision
,smoothFactor?
):number
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:75
Add a new logic element to calcluate a number.
Parameters
Parameter | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data ) => void | A callback hander to take new values as numbers. |
precision | number | An optional precision to require for updates to be sent. |
smoothFactor? | number | An optional linear smoothing factor to apply to the value when updating. |
Returns
number
The current value of the logic.
addLogicAsString()
addLogicAsString(
logic
,handler
):string
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:86
Add a new logic element to calcluate a string.
Parameters
Parameter | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data ) => void | A callback hander to take new values as strings. |
Returns
string
The current value of the logic.
setIsPaused()
setIsPaused(
isPaused
):void
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:52
Set to pause the logic update loop.
Parameters
Parameter | Type | Description |
---|---|---|
isPaused | boolean | True to pause, false to resume. |
Returns
void
update()
update(
deltaTime
):void
Defined in: src/sdk/data/CompositeLogicXMLHost.ts:108
Update every logic element and publish updates.
Parameters
Parameter | Type | Description |
---|---|---|
deltaTime | number | The time since the last update, in ms. |
Returns
void