Class: CompositeLogicXMLHost
Constructors
constructor
• new CompositeLogicXMLHost(startPaused?
): CompositeLogicXMLHost
Ctor
Parameters
Name | Type | Default value | Description |
---|---|---|---|
startPaused | boolean | false | True to start paused. |
Returns
Defined in
src/sdk/data/CompositeLogicXMLHost.ts:44
Methods
addFunction
▸ addFunction(funcSpec
): string
| number
Add a function to the logic context.
Parameters
Name | Type | Description |
---|---|---|
funcSpec | XMLFunction | The 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
Name | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data : string | number ) => void | A 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
Name | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data : number ) => 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.
Defined in
src/sdk/data/CompositeLogicXMLHost.ts:75
addLogicAsString
▸ addLogicAsString(logic
, handler
): string
Add a new logic element to calcluate a string.
Parameters
Name | Type | Description |
---|---|---|
logic | CompositeLogicXMLElement | A CompositeLogicXMLElement. |
handler | (data : string ) => void | A 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
Name | Type | Description |
---|---|---|
isPaused | boolean | True 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
Name | Type | Description |
---|---|---|
deltaTime | number | The time since the last update, in ms. |
Returns
void
Defined in
src/sdk/data/CompositeLogicXMLHost.ts:108