requirements are now arrays of objects

master
Theunis J. Botha 2021-10-02 10:27:25 +02:00
parent 2b8c94cb25
commit c9fa144d02
48 changed files with 949 additions and 5831 deletions

4
dist/index.html vendored
View File

@ -28,6 +28,10 @@
</script>
<script type="application/javascript">
window.addEventListener("load", function(){
let x = [];
x[0] = 1;
x[1] = 2;
console.log(x,x);
let canvas = new R3.Canvas();
let image = new R3.Image();
let touch = new R3.Touch();

3319
dist/r3.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "r3",
"version": "3.0.214",
"version": "3.0.245",
"description": "",
"private": true,
"dependencies": {

25
r3.php
View File

@ -537,6 +537,21 @@ function extractOption($item, $template)
{
$item = trim($item);
$indexes = [];
$index = null;
if (preg_match('/^\[(\d+)\]/', $item, $indexes)) {
$index=$indexes[1];
$item = preg_replace('/^\[\d+\]/','', $item);
}
// $arrayType = null;
// $arrayTypes = [];
// if (preg_match('/^.*?=\[(\w+)\]/', $item, $arrayTypes)) {
// $arrayType=$arrayTypes[1];
// $item = preg_replace('/=\[\w+\]/','=[]', $item);
// }
$matches = [];
$key_value = preg_match('/^(\s*\w+)=(.*)$/', $item, $matches);
@ -572,6 +587,11 @@ function extractOption($item, $template)
$updated = str_replace('COMMENT', $comment, $template);
$updated = str_replace('KEY', $key, $updated);
$updated = str_replace('VALUE', $value, $updated);
if ($index !== null) {
$updated = str_replace('INDEX', $index, $updated);
}
return $updated;
}
@ -1317,7 +1337,7 @@ function generateImports($file, $tokens, $command)
array_key_exists('CUSTOM_REQUIRED_COMPONENTS', $tokens) &&
sizeof($tokens['CUSTOM_REQUIRED_COMPONENTS']) > 0
) {
array_push($updates, "const Event = require('../r3-event.js');\n");
// array_push($updates, "const Event = require('../r3-event.js');\n");
}
if (
@ -2142,7 +2162,8 @@ if ($argv[2] == 'build-dist') {
*/
foreach ($files as $file) {
generateInherited($file, $restoreTokens);
echo $argc;
// generateInherited($file, $restoreTokens);
}

View File

@ -6,121 +6,13 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const ComponentGeometry = require('./r3-component-geometry.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry.BufferGeometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentBufferGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -247,15 +139,7 @@ class ComponentBufferGeometry extends ComponentGeometry {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,125 +6,13 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const ComponentDOM = require('./r3-component-d-o-m.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.DOM.Canvas
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentDOM]
Inherited Properties:
- instance (Default value null - Holds the current instance of this object as determined (built) by
the runtime object.)
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentCanvas]
Properties:
- type (Default value 'canvas')
- width (Default value 500 - The initial width of the canvas (You can override it with CSS))
- height (Default value 500 - The initial height of the canvas (You can override it with CSS))
- style (Default value 'border:1px solid #00bb00;')
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -276,22 +164,12 @@ class ComponentCanvas extends ComponentDOM {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.CANVAS_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.CANVAS_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Code
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentCode]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -228,15 +138,7 @@ class ComponentCode extends Component {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,103 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.DOM
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentDOM]
Properties:
- instance (Default value null - Holds the current instance of this object as determined (built) by
the runtime object.)
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -232,22 +141,12 @@ class ComponentDOM extends Component {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.DOM_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.DOM_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -228,15 +138,7 @@ class ComponentGeometry extends Component {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Graphics
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentGraphics]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -224,22 +134,12 @@ class ComponentGraphics extends Component {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -7,137 +7,13 @@ const Utils = require('../r3-utils.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const ComponentGraphics = require('./r3-component-graphics.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Graphics.Image
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGraphics]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentImage]
Properties:
- src (Default value
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSotDu0g4pChumhBVMRRq1CECqFWaNXB5NIvaNKQpLg4Cq4FBz8Wqw4uzro6uAqC4AeIm5uToouU+L+k0CLWg+N+vLv3uHsHCPUy06yucUDTbTOViIuZ7KoYeEUvwgghgFGZWcacJCXRcXzdw8fXuxjP6nzuzxFScxYDfCLxLDNMm3iDeHrTNjjvE0dYUVaJz4nHTLog8SPXFY/fOBdcFnhmxEyn5okjxGKhjZU2ZkVTI54ijqqaTvlCxmOV8xZnrVxlzXvyFwZz+soy12kOIYFFLEGCCAVVlFCGjRitOikWUrQf7+AfdP0SuRRylcDIsYAKNMiuH/wPfndr5ScnvKRgHOh+cZyPYSCwCzRqjvN97DiNE8D/DFzpLX+lDsx8kl5radEjoH8buLhuacoecLkDDDwZsim7kp+mkM8D72f0TVkgfAv0rXm9Nfdx+gCkqavkDXBwCIwUKHu9w7t72nv790yzvx9QEXKZwXQv9wAAAAZiS0dEADIANAAxUB4d7wAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+UJEw0JHX/9/lIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADUlEQVQI12Ng+M+gBgADKAEm2Ka93QAAAABJRU5ErkJggg)
- alt (Default value '15% opaque 1x1 green pixel' - The alt attribute of this image)
- fileName (Default value Utils.LowerUnderscore(options.name) - Name of the image under which it is
stored)
- extension (Default value '.png' - Extension of the file name including the '.' (ex. '.jpg'))
- external_path (Default value '/images/' + options.id + '.png' - Path to the image relative to the
project defined API URL)
- internal_path (Default value '/tmp/' + options.id + '.png' - Server side path on the server to the
file, excluding filename)
- contentType (Default value 'image/png' - Content type of the file (based on the extension, ex.
'image/jpeg'))
- size (Default value 565 - Size of the file in bytes)
- width (Default value 1 - Width of the image in pixels)
- height (Default value 1 - height of the image in pixels)
- orientation (Default value 'square' - The orientation of the image, one of 'square', 'landscape',
'portrait')
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -367,22 +243,12 @@ class ComponentImage extends ComponentGraphics {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.IMAGE_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.IMAGE_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Input
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentInput]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -224,22 +134,12 @@ class ComponentInput extends Component {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.INPUT_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.INPUT_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Material
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentMaterial]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -228,15 +138,7 @@ class ComponentMaterial extends Component {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Mesh
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentMesh]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -228,15 +138,7 @@ class ComponentMesh extends Component {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,139 +6,13 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const ComponentBufferGeometry = require('./r3-component-buffer-geometry.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Geometry.BufferGeometry.PlaneGeometry
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentBufferGeometry]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentPlaneGeometry]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -265,15 +139,7 @@ class ComponentPlaneGeometry extends ComponentBufferGeometry {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,102 +6,12 @@ const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Texture
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentTexture]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -228,15 +138,7 @@ class ComponentTexture extends Component {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -1,128 +1,19 @@
//GENERATED_IMPORTS_START
const Event = require('../r3-event.js');
const Entity = require('../r3-entity/r3-entity.js');
//GENERATED_IMPORTS_END
//CUSTOM_IMPORTS_START
const ComponentCanvas = require('../r3-component/r3-component-canvas.js');
const ComponentDOM = require('../r3-component/r3-component-d-o-m.js');
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const ComponentInput = require('./r3-component-input.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Component.Input.Touch
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Component]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from ComponentInput]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to ComponentTouch]
Properties:
- canvas (Default value null - A Touch Component requires a Canvas component to bind to.)
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -130,11 +21,11 @@ const ComponentInput = require('./r3-component-input.js');
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START
canvas=null - A Touch Component requires a Canvas component to bind to.
domComponent=null - A Touch Component requires a Canvas component to bind to.
CUSTOM_OPTIONS_END
CUSTOM_REQUIRED_COMPONENTS_START
canvas=ComponentCanvas
[0]domComponent=ComponentDOM
CUSTOM_REQUIRED_COMPONENTS_END
TEMPLATE_STATIC_OPTIONS_START
@ -207,22 +98,25 @@ class ComponentTouch extends ComponentInput {
//GENERATED_OPTIONS_INIT_START
/**
* canvas - A Touch Component requires a Canvas component to bind to.
* domComponent - A Touch Component requires a Canvas component to bind to.
*/
if (typeof options.canvas === 'undefined') {
options.canvas = null;
if (typeof options.domComponent === 'undefined') {
options.domComponent = null;
}
//GENERATED_OPTIONS_INIT_END
//GENERATED_REQUIRED_COMPONENTS_START
/**
* canvas - No comment
* domComponent - No comment
*/
options.required.canvas = ComponentCanvas;
this.canvasBackup = options.canvas;
if (typeof options.required[0] === 'undefined') {
options.required[0] = {};
}
options.required[0].domComponent = ComponentDOM;
this.domComponentBackup = options.domComponent;
Object.defineProperty(
this,
'canvas',
'domComponent',
{
configurable : true,
enumerable : true,
@ -230,24 +124,24 @@ class ComponentTouch extends ComponentInput {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATE,
{
r3object : this,
property : 'canvas',
r3Object : this,
property : 'domComponent',
value : x
}
);
this.canvasBackup = x;
this.domComponentBackup = x;
Event.Emit(
Event.OBJECT_PROPERTY_UPDATED,
{
r3object : this,
property : 'canvas',
r3Object : this,
property : 'domComponent',
value : x
}
);
return x;
},
get : function() {
return this.canvasBackup;
return this.domComponentBackup;
}
}
)
@ -289,22 +183,12 @@ class ComponentTouch extends ComponentInput {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.TOUCH_COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.TOUCH_COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}
@ -323,14 +207,14 @@ class ComponentTouch extends ComponentInput {
this.emit(Event.UPDATE_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_INSTANCE_OPTIONS_START
if (property === 'canvas') {
this.instance.canvas = this.canvas;
if (property === 'domComponent') {
this.instance.domComponent = this.domComponent;
this.emit(
Event.UPDATE_INSTANCE_PROPERTY,
{
component : this,
property : 'canvas',
instanceProperty : 'canvas'
property : 'domComponent',
instanceProperty : 'domComponent'
}
);
if (property !== 'all') {
@ -364,14 +248,14 @@ class ComponentTouch extends ComponentInput {
this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this);
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START
if (property === 'canvas' || property === 'all') {
this.canvas = this.instance.canvas;
if (property === 'domComponent' || property === 'all') {
this.domComponent = this.instance.domComponent;
this.emit(
Event.UPDATE_PROPERTY_FROM_INSTANCE,
{
component : this,
property : 'canvas',
instanceProperty : 'canvas'
property : 'domComponent',
instanceProperty : 'domComponent'
}
);
if (property !== 'all') {

View File

@ -12,79 +12,6 @@ const R3Object = require('../r3-object/r3-object.js');
GENERATED_INHERITED_START
Class R3.Event.Object.Component
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to Component]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -177,9 +104,7 @@ class Component extends R3Object {
//CUSTOM_INITIALIZE_METHOD_START
super.initialize();
if (this.initialized) {
Event.Emit(Event.COMPONENT_INITIALIZED, this);
}
Event.Emit(Event.COMPONENT_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START

View File

@ -1,5 +1,4 @@
//GENERATED_IMPORTS_START
const Event = require('../r3-event.js');
const Component = require('../r3-component/r3-component.js');
//GENERATED_IMPORTS_END
@ -9,108 +8,13 @@ const ComponentCanvas = require('../r3-component/r3-component-canvas.js');
const ComponentTouch = require('../r3-component/r3-component-touch.js');
//CUSTOM_IMPORTS_END
const Event = require('../r3-event.js');
const Entity = require('./r3-entity.js');
/**
GENERATED_INHERITED_START
Class R3.Event.Object.Entity.Slider
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from Entity]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to EntitySlider]
Properties:
- canvas (Default value null - The Canvas Component to which this entity binds its custom code
components)
- touch (Default value null - The slider component reacts to TOUCH Events, for this a touch
component is required)
- images (Default value [] - The Image Components which will be used to slide from one image to the
next)
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -128,9 +32,9 @@ const Entity = require('./r3-entity.js');
CUSTOM_OPTIONS_END
CUSTOM_REQUIRED_COMPONENTS_START
images=[ComponentImage] - We need a list of at least one Image which to slide
canvas=ComponentCanvas - We need a Canvas to attach our Input events
touch=ComponentTouch - We need a Touch Component to respond to TOUCH Events
[0]images=[ComponentImage] - We need a list of at least one Image which to slide
[0]canvas=ComponentCanvas - We need a Canvas to attach our Input events
[0]touch=ComponentTouch - We need a Touch Component to respond to TOUCH Events
CUSTOM_REQUIRED_COMPONENTS_END
TEMPLATE_STATIC_OPTIONS_START
@ -249,7 +153,10 @@ class EntitySlider extends Entity {
/**
* images - We need a list of at least one Image which to slide
*/
options.required.images = [ComponentImage];
if (typeof options.required[0] === 'undefined') {
options.required[0] = {};
}
options.required[0].images = [ComponentImage];
this.imagesBackup = options.images;
Object.defineProperty(
this,
@ -261,7 +168,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATE,
{
r3object : this,
r3Object : this,
property : 'images',
value : x
}
@ -270,7 +177,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATED,
{
r3object : this,
r3Object : this,
property : 'images',
value : x
}
@ -284,7 +191,10 @@ class EntitySlider extends Entity {
) /**
* canvas - We need a Canvas to attach our Input events
*/
options.required.canvas = ComponentCanvas;
if (typeof options.required[0] === 'undefined') {
options.required[0] = {};
}
options.required[0].canvas = ComponentCanvas;
this.canvasBackup = options.canvas;
Object.defineProperty(
this,
@ -296,7 +206,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATE,
{
r3object : this,
r3Object : this,
property : 'canvas',
value : x
}
@ -305,7 +215,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATED,
{
r3object : this,
r3Object : this,
property : 'canvas',
value : x
}
@ -319,7 +229,10 @@ class EntitySlider extends Entity {
) /**
* touch - We need a Touch Component to respond to TOUCH Events
*/
options.required.touch = ComponentTouch;
if (typeof options.required[0] === 'undefined') {
options.required[0] = {};
}
options.required[0].touch = ComponentTouch;
this.touchBackup = options.touch;
Object.defineProperty(
this,
@ -331,7 +244,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATE,
{
r3object : this,
r3Object : this,
property : 'touch',
value : x
}
@ -340,7 +253,7 @@ class EntitySlider extends Entity {
Event.Emit(
Event.OBJECT_PROPERTY_UPDATED,
{
r3object : this,
r3Object : this,
property : 'touch',
value : x
}
@ -390,22 +303,12 @@ class EntitySlider extends Entity {
//GENERATED_INITIALIZE_METHOD_END
//CUSTOM_INITIALIZE_METHOD_START
if (this.initialized) {
Event.Emit(Event.SLIDER_ENTITY_INITIALIZED, this);
}
Event.Emit(Event.SLIDER_ENTITY_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -12,79 +12,6 @@ const R3Object = require('../r3-object/r3-object.js');
GENERATED_INHERITED_START
Class R3.Event.Object.Entity
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to Entity]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -177,9 +104,7 @@ class Entity extends R3Object {
//CUSTOM_INITIALIZE_METHOD_START
this.setInitialized();
if (this.initialized) {
Event.Emit(Event.ENTITY_INITIALIZED, this);
}
Event.Emit(Event.ENTITY_INITIALIZED, this);
//CUSTOM_INITIALIZE_METHOD_END
//GENERATED_INITIALIZE_METHOD_AFTER_START

View File

@ -362,42 +362,43 @@ Event.DOM_COMPONENT_INITIALIZED = 0x9;
Event.ENTITY_CREATED = 0xa;
Event.ENTITY_INITIALIZED = 0xb;
Event.ENTITY_STARTED = 0xc;
Event.GET_API_URL = 0xd;
Event.GET_RUNTIME = 0xe;
Event.GET_WINDOW_SIZE = 0xf;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0x10;
Event.IMAGE_COMPONENT_INITIALIZED = 0x11;
Event.IMAGE_INSTANCE_CREATED = 0x12;
Event.INPUT_COMPONENT_INITIALIZED = 0x13;
Event.INSTANCE_CREATED = 0x14;
Event.INSTANCE_DISPOSED = 0x15;
Event.KEYBOARD_DOWN = 0x16;
Event.KEYBOARD_UP = 0x17;
Event.MOUSE_DOWN = 0x18;
Event.MOUSE_MOVE = 0x19;
Event.MOUSE_UP = 0x1a;
Event.MOUSE_WHEEL = 0x1b;
Event.OBJECT_CREATED = 0x1c;
Event.OBJECT_PROPERTY_UPDATE = 0x1d;
Event.OBJECT_PROPERTY_UPDATED = 0x1e;
Event.PAUSE = 0x1f;
Event.PROJECT_INITIALIZED = 0x20;
Event.RESTART = 0x21;
Event.RUNTIME_CREATED = 0x22;
Event.SLIDER_ENTITY_INITIALIZED = 0x23;
Event.START = 0x24;
Event.TOUCH_CANCEL = 0x25;
Event.TOUCH_COMPONENT_INITIALIZED = 0x26;
Event.TOUCH_END = 0x27;
Event.TOUCH_MOVE = 0x28;
Event.TOUCH_START = 0x29;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x2a;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x2b;
Event.UPDATE_INSTANCE_AFTER = 0x2c;
Event.UPDATE_INSTANCE_BEFORE = 0x2d;
Event.UPDATE_INSTANCE_PROPERTY = 0x2e;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2f;
Event.MAX_EVENTS = 0x30;
Event.FINAL_INITIALIZE = 0xd;
Event.GET_API_URL = 0xe;
Event.GET_RUNTIME = 0xf;
Event.GET_WINDOW_SIZE = 0x10;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0x11;
Event.IMAGE_COMPONENT_INITIALIZED = 0x12;
Event.IMAGE_INSTANCE_CREATED = 0x13;
Event.INPUT_COMPONENT_INITIALIZED = 0x14;
Event.INSTANCE_CREATED = 0x15;
Event.INSTANCE_DISPOSED = 0x16;
Event.KEYBOARD_DOWN = 0x17;
Event.KEYBOARD_UP = 0x18;
Event.MOUSE_DOWN = 0x19;
Event.MOUSE_MOVE = 0x1a;
Event.MOUSE_UP = 0x1b;
Event.MOUSE_WHEEL = 0x1c;
Event.OBJECT_CREATED = 0x1d;
Event.OBJECT_PROPERTY_UPDATE = 0x1e;
Event.OBJECT_PROPERTY_UPDATED = 0x1f;
Event.PAUSE = 0x20;
Event.PROJECT_INITIALIZED = 0x21;
Event.RESTART = 0x22;
Event.RUNTIME_CREATED = 0x23;
Event.SLIDER_ENTITY_INITIALIZED = 0x24;
Event.START = 0x25;
Event.TOUCH_CANCEL = 0x26;
Event.TOUCH_COMPONENT_INITIALIZED = 0x27;
Event.TOUCH_END = 0x28;
Event.TOUCH_MOVE = 0x29;
Event.TOUCH_START = 0x2a;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x2b;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x2c;
Event.UPDATE_INSTANCE_AFTER = 0x2d;
Event.UPDATE_INSTANCE_BEFORE = 0x2e;
Event.UPDATE_INSTANCE_PROPERTY = 0x2f;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x30;
Event.MAX_EVENTS = 0x31;
Event.GetEventName = function(eventId) {
@ -414,41 +415,42 @@ Event.GetEventName = function(eventId) {
case 0xa : return 'entity_created';
case 0xb : return 'entity_initialized';
case 0xc : return 'entity_started';
case 0xd : return 'get_api_url';
case 0xe : return 'get_runtime';
case 0xf : return 'get_window_size';
case 0x10 : return 'graphics_component_initialized';
case 0x11 : return 'image_component_initialized';
case 0x12 : return 'image_instance_created';
case 0x13 : return 'input_component_initialized';
case 0x14 : return 'instance_created';
case 0x15 : return 'instance_disposed';
case 0x16 : return 'keyboard_down';
case 0x17 : return 'keyboard_up';
case 0x18 : return 'mouse_down';
case 0x19 : return 'mouse_move';
case 0x1a : return 'mouse_up';
case 0x1b : return 'mouse_wheel';
case 0x1c : return 'object_created';
case 0x1d : return 'object_property_update';
case 0x1e : return 'object_property_updated';
case 0x1f : return 'pause';
case 0x20 : return 'project_initialized';
case 0x21 : return 'restart';
case 0x22 : return 'runtime_created';
case 0x23 : return 'slider_entity_initialized';
case 0x24 : return 'start';
case 0x25 : return 'touch_cancel';
case 0x26 : return 'touch_component_initialized';
case 0x27 : return 'touch_end';
case 0x28 : return 'touch_move';
case 0x29 : return 'touch_start';
case 0x2a : return 'update_from_instance_after';
case 0x2b : return 'update_from_instance_before';
case 0x2c : return 'update_instance_after';
case 0x2d : return 'update_instance_before';
case 0x2e : return 'update_instance_property';
case 0x2f : return 'update_property_from_instance';
case 0xd : return 'final_initialize';
case 0xe : return 'get_api_url';
case 0xf : return 'get_runtime';
case 0x10 : return 'get_window_size';
case 0x11 : return 'graphics_component_initialized';
case 0x12 : return 'image_component_initialized';
case 0x13 : return 'image_instance_created';
case 0x14 : return 'input_component_initialized';
case 0x15 : return 'instance_created';
case 0x16 : return 'instance_disposed';
case 0x17 : return 'keyboard_down';
case 0x18 : return 'keyboard_up';
case 0x19 : return 'mouse_down';
case 0x1a : return 'mouse_move';
case 0x1b : return 'mouse_up';
case 0x1c : return 'mouse_wheel';
case 0x1d : return 'object_created';
case 0x1e : return 'object_property_update';
case 0x1f : return 'object_property_updated';
case 0x20 : return 'pause';
case 0x21 : return 'project_initialized';
case 0x22 : return 'restart';
case 0x23 : return 'runtime_created';
case 0x24 : return 'slider_entity_initialized';
case 0x25 : return 'start';
case 0x26 : return 'touch_cancel';
case 0x27 : return 'touch_component_initialized';
case 0x28 : return 'touch_end';
case 0x29 : return 'touch_move';
case 0x2a : return 'touch_start';
case 0x2b : return 'update_from_instance_after';
case 0x2c : return 'update_from_instance_before';
case 0x2d : return 'update_instance_after';
case 0x2e : return 'update_instance_before';
case 0x2f : return 'update_instance_property';
case 0x30 : return 'update_property_from_instance';
default :
throw new Error('Event type not defined : ' + eventId);
}

View File

@ -13,61 +13,6 @@ const Utils = require('.././r3-utils');
GENERATED_INHERITED_START
Class R3.Event.Object
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Belonging to R3Object]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -78,7 +23,7 @@ const Utils = require('.././r3-utils');
initializeDepth=0 - The amount of times this Object passed through initialize() functions
parents=[] - All Objects could have parent(s)
children=[] - All Objects could have some children
required={} - All Objects could have some required Objects which need to initialize before this Object can initialize
required=[Object] - All Objects could have some required Objects which need to initialize before this Object can initialize
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START
@ -176,7 +121,7 @@ class R3Object extends Event {
* initialize
*/
if (typeof options.required === 'undefined') {
options.required = {};
options.required = [Object];
}
//GENERATED_TEMPLATE_OPTIONS_INIT_END
@ -242,85 +187,7 @@ class R3Object extends Event {
) {
//GENERATED_SET_INITIALIZED_METHOD_START
let isReady = function(property, value) {
console.log('checking requirements for ' + property);
if (this.required[property] instanceof Array) {
/**
* First we need to check if we have this array defined
*/
if (!(value instanceof Array)) {
throw new Error('The property ' + property + ' of this object was not properly defined - it should be an array');
}
if (value.length === 0) {
return false;
}
/**
* Check all properties are an instance of this.required[property]
*/
for (let i = 0; i < value.length; i++) {
this.required[property].map(
function(constructor) {
if (!(value[i] instanceof constructor)) {
throw new Error('The property ' + property + ' of this object is not of the correct type');
}
}.bind(this)
);
}
for (let i = 0; i < value.length; i++) {
if (value[i].initialized !== true) {
return false;
}
}
return true;
} else {
if (value === null) {
return false;
} else {
if (typeof value === 'undefined') {
throw new Error('The ' + property + ' is not defined');
}
if (!(value instanceof this.required[property])) {
throw new Error('The property ' + property + ' of this object is not of the correct type')
}
if (value.initialized !== true) {
return false;
}
return true;
}
}
}.bind(this);
this.initialized = true;
for (let requiredProperty in this.required) {
if (this.required.hasOwnProperty(requiredProperty)) {
if (requiredProperty === property) {
if (!isReady(property, value)) {
this.initialized = false;
return;
}
} else {
if (!isReady(requiredProperty, this[requiredProperty])) {
this.initialized = false;
return;
}
}
}
}
//GENERATED_SET_INITIALIZED_METHOD_END
//CUSTOM_SET_INITIALIZED_METHOD_START

View File

@ -14,79 +14,6 @@ const R3Object = require('./r3-object.js');
GENERATED_INHERITED_START
Class R3.Event.Object.Project
[Inherited from Event]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Inherited Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to Project]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -224,15 +151,7 @@ class Project extends R3Object {
//GENERATED_INITIALIZE_METHOD_AFTER_START
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -6,61 +6,6 @@ const RuntimePhysics = require('./r3-runtime-physics.js');
GENERATED_INHERITED_START
Class R3.Runtime.Physics.Bullet
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimePhysics]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeBullet]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeCoder = require('./r3-runtime-coder.js');
GENERATED_INHERITED_START
Class R3.Runtime.Coder.CodeMirror
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeCoder]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeCodeMirror]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeGUI = require('./r3-runtime-g-u-i.js');
GENERATED_INHERITED_START
Class R3.Runtime.GUI.ControlKit
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeGUI]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeControlKit]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js');
GENERATED_INHERITED_START
Class R3.Runtime.DOM.Document
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeDOM]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeDocument]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeImage = require('./r3-runtime-image.js');
GENERATED_INHERITED_START
Class R3.Runtime.Image.NodeJSImage
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeImage]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeNodeJSImage]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeStatistics = require('./r3-runtime-statistics.js');
GENERATED_INHERITED_START
Class R3.Runtime.Statistics.Stats
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeStatistics]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeStats]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeGraphics = require('./r3-runtime-graphics.js');
GENERATED_INHERITED_START
Class R3.Runtime.Graphics.Three
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeGraphics]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeThree]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -6,61 +6,6 @@ const RuntimeImage = require('./r3-runtime-image.js');
GENERATED_INHERITED_START
Class R3.Runtime.Image.WebImage
[Inherited from Runtime]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Inherited from RuntimeImage]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to RuntimeWebImage]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -11,43 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.DOM
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemDOM]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -11,43 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Input
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemInput]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -4,6 +4,7 @@
//CUSTOM_IMPORTS_START
const R3Object = require('../r3-object/r3-object.js');
const Utils = require('../r3-utils.js');
const Entity = require('../r3-entity/r3-entity.js');
//CUSTOM_IMPORTS_END
const Event = require('.././r3-event');
@ -13,44 +14,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Linking
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemLinking]
Properties:
<no properties>
Static Properties:
- BlacklistedComponents (Default value [] - A list of component constructors which should not be
permitted to create instances immediately)
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START
@ -93,6 +56,10 @@ const System = require('./r3-system.js');
TEMPLATE_STATIC_METHODS_END
CUSTOM_STATIC_METHODS_START
SanityChecks(r3Object, property, value) - When an object gets some value assigned to a property, we need to check if this property is a required property, and if so, the value assigned to this property needs to conform to the type restrictions enforced by the requirements objects.
SetParentChildRelationships(r3Object, property, value) - When an object gets some value assigned to a property, and it is a required property, we need to ensure that the proper parent / child relationships are maintained
DetermineReadyState(r3Object, property, value) - When an object is assigned some value to one of its required properties, we should determine the 'readiness' state of this R3 Object. Ready objects, can have their instances created.
ActivateInstances()
CUSTOM_STATIC_METHODS_END
**/
@ -242,6 +209,241 @@ class SystemLinking extends System {
//GENERATED_TEMPLATE_STATIC_METHODS_END
//GENERATED_STATIC_METHODS_START
/**
* SanityChecks()
* - When an object gets some value assigned to a property, we need to check if this property is a required
* property, and if so, the value assigned to this property needs to conform to the type restrictions enforced by
* the requirements objects.
* @param r3Object
* @param property
* @param value
*/
static SanityChecks(
r3Object,
property,
value
) {
//GENERATED_STATIC_SANITY_CHECKS_METHOD_START
//GENERATED_STATIC_SANITY_CHECKS_METHOD_END
//CUSTOM_STATIC_SANITY_CHECKS_METHOD_START
/**
* First we check if this is a required property
*/
if (!r3Object.required.hasOwnProperty(property)) {
return;
}
/**
* We know this property is required - so continue..
*/
if (r3Object.required[property] instanceof Array) {
/**
* First we need to check that this value conforms to the requirement of being an Array
*/
if (!(value instanceof Array)) {
throw new TypeError('The property ' + property + ' of ' + r3Object.name + ' was not properly defined - it should be an array');
}
if (value.length === 0) {
return;
}
/**
* Check all items in the array are valid objects of type r3Object.required[property]
*/
for (let i = 0; i < value.length; i++) {
r3Object.required[property].map(
function(constructor) {
if (!(value[i] instanceof constructor)) {
throw new TypeError('The property ' + property + ' of this object is not of the correct type');
}
}
);
}
} else {
if (value === null) {
return;
}
if (typeof value === 'undefined') {
return;
}
if (!(value instanceof r3Object.required[property])) {
throw new TypeError('The property ' + property + ' of ' + r3Object.name + ' is not of the correct type')
}
}
//CUSTOM_STATIC_SANITY_CHECKS_METHOD_END
}
/**
* SetParentChildRelationships()
* - When an object gets some value assigned to a property, and it is a required property, we need to ensure that
* the proper parent / child relationships are maintained
* @param r3Object
* @param property
* @param value
*/
static SetParentChildRelationships(
r3Object,
property,
value
) {
//GENERATED_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD_START
//GENERATED_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD_END
//CUSTOM_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD_START
if (value instanceof Array) {
/**
* This object could have its property set to an empty array.
* In this case - we should check its existing components and have their relationships
* severed
*/
if (value.length === 0) {
if (r3Object[property] instanceof Array) {
for (let i = 0; i < r3Object[property].length; i++) {
if (r3Object[property][i] instanceof R3Object) {
r3Object.dirty = true;
Utils.RemoveFromArray(r3Object[property][i].parents, r3Object);
}
}
}
} else {
/**
* We need to check if we removed an item from the existing array
*/
if (r3Object[property].length > 0) {
}
for (let i = 0; i < value.length; i++) {
if (value[i] instanceof R3Object) {
Utils.PushUnique(value[i].parents, r3Object);
Utils.PushUnique(r3Object.children, value[i]);
if (r3Object instanceof Entity) {
Utils.PushUnique(r3Object.components, value[i]);
}
}
}
}
}
if (value instanceof R3Object) {
Utils.PushUnique(value.parents, r3Object);
Utils.PushUnique(r3Object.children, value);
if (r3Object instanceof Entity) {
Utils.PushUnique(r3Object.components, value);
}
}
//CUSTOM_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD_END
}
/**
* DetermineReadyState()
* - When an object is assigned some value to one of its required properties, we should determine the 'readiness'
* state of this R3 Object. Ready objects, can have their instances created.
* @param r3Object
* @param property
* @param value
*/
static DetermineReadyState(
r3Object,
property,
value
) {
//GENERATED_STATIC_DETERMINE_READY_STATE_METHOD_START
//GENERATED_STATIC_DETERMINE_READY_STATE_METHOD_END
//CUSTOM_STATIC_DETERMINE_READY_STATE_METHOD_START
console.log('Determining ready state for ' + r3Object.name);
// if (r3Object.required[property] instanceof Array) {
//
// if (value.length === 0) {
// return false;
// }
//
// for (let i = 0; i < value.length; i++) {
// if (value[i].initialized !== true) {
// return false;
// }
// }
//
// return true;
//
// } else {
//
// if (value === null) {
// return false;
// } else {
//
// if (value.initialized !== true) {
// return false;
// }
//
// return true;
// }
// }
// for (let requiredProperty in this.required) {
// if (this.required.hasOwnProperty(requiredProperty)) {
// if (requiredProperty === property) {
// if (!isReady(property, value)) {
// this.initialized = false;
// return;
// }
// } else {
// if (!isReady(requiredProperty, this[requiredProperty])) {
// this.initialized = false;
// return;
// }
// }
// }
// }
//CUSTOM_STATIC_DETERMINE_READY_STATE_METHOD_END
}
/**
* ActivateInstances()
* - No comment
*/
static ActivateInstances() {
//GENERATED_STATIC_ACTIVATE_INSTANCES_METHOD_START
//GENERATED_STATIC_ACTIVATE_INSTANCES_METHOD_END
//CUSTOM_STATIC_ACTIVATE_INSTANCES_METHOD_START
// if (this instanceof Component && this.initialized) {
// this.createInstance();
// }
//
// if (this instanceof Entity && this.initialized && !this.started) {
// this.start();
// }
//CUSTOM_STATIC_ACTIVATE_INSTANCES_METHOD_END
}
//GENERATED_STATIC_METHODS_END
//GENERATED_EVENT_LISTENER_METHODS_START
@ -373,77 +575,52 @@ class SystemLinking extends System {
//GENERATED_STATIC_ON_OBJECT_PROPERTY_UPDATE_METHOD_END
//CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATE_METHOD_START
let {value, property, r3object} = object;
let {value, property, r3Object} = object;
// object = object.object;
console.log('object property update of ' + property);
console.log('Object property update: ' + r3Object.constructor.name + '.' + property);
/**
* First we need to perform some sanity checks on the property
*/
SystemLinking.SanityChecks(r3Object, property, value);
/**
* Set the parent relationships
*/
if (value instanceof Array) {
SystemLinking.SetParentChildRelationships(r3Object, property, value);
/**
* This object could have its property set to an empty array.
* In this case - we should check its existing components and have their relationships
* severed
*/
if (value.length === 0) {
if (r3object[property] instanceof Array) {
for (let i = 0; i < r3object[property].length; i++) {
if (r3object[property][i] instanceof R3Object) {
r3object.dirty = true;
Utils.RemoveFromArray(r3object[property][i].parents, r3object);
}
}
}
} else {
/**
* This
*/
for (let i = 0; i < value.length; i++) {
if (value[i] instanceof R3Object) {
Utils.PushUnique(value[i].parents, r3object);
}
}
}
}
if (value instanceof R3Object) {
Utils.PushUnique(value.parents, r3object);
}
/**
* Determine the ready state of the r3Object
*/
SystemLinking.DetermineReadyState(r3Object, property, value);
/**
* The value was unassigned - remove the parent relationships of the existing
* components (if available)
*/
if (value === null || typeof value === 'undefined') {
if (r3object[property] instanceof R3Object) {
r3object.dirty = true;
Utils.RemoveFromArray(r3object[property].parents, r3object);
}
}
if (!r3object.underConstruction) {
if (r3object.initialized) {
/**
* Check if this object will still be initialized after this assignment completes
*/
r3object.setInitialized(property, value);
if (!r3object.initialized) {
//We set this object back to initialized because it is still initialized - it WILL be not initialized in the future
r3object.initialized = true;
r3object.stop();
}
}
}
// if (value === null || typeof value === 'undefined') {
// if (r3Object[property] instanceof R3Object) {
// r3Object.dirty = true;
// Utils.RemoveFromArray(r3Object[property].parents, r3Object);
// }
// }
//
// if (!r3Object.underConstruction) {
//
// if (r3Object.initialized) {
// /**
// * Check if this object will still be initialized after this assignment completes
// */
// r3Object.setInitialized(property, value);
// if (!r3Object.initialized) {
// //We set this object back to initialized because it is still initialized - it WILL be not initialized in the future
// r3Object.initialized = true;
// r3Object.stop();
// }
// }
// }
//CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATE_METHOD_END
@ -461,9 +638,9 @@ class SystemLinking extends System {
//GENERATED_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_END
//CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_START
let {r3object} = object;
let {r3Object} = object;
if (!r3object.underConstruction) {
if (!r3Object.underConstruction) {
/**
* At this point - the object entity would have been brought to a stop
@ -472,12 +649,12 @@ class SystemLinking extends System {
* We can safely clear the dirty flag.
*/
if (r3object.dirty) {
r3object.dirty = false;
if (r3Object.dirty) {
r3Object.dirty = false;
}
r3object.initializeDepth = 0;
r3object.initialize();
r3Object.initializeDepth = 0;
r3Object.initialize();
}
//CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_END

View File

@ -11,43 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Render
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemRender]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -11,50 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Runtime
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemRuntime]
Properties:
<no properties>
Static Properties:
- Projects (Default value [])
- CurrentProject (Default value null)
- RuntimeCoder (Default value {})
- RuntimeDOM (Default value {})
- RuntimeGUI (Default value {})
- RuntimeGraphics (Default value {})
- RuntimePhysics (Default value {})
- RuntimeStatistics (Default value {})
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -11,43 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Socket
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemSocket]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -11,43 +11,6 @@ const System = require('./r3-system.js');
GENERATED_INHERITED_START
Class R3.System.Storage
[Inherited from System]
Inherited Properties:
<no inherited properties>
Inherited Static Properties:
<no inherited static properties>
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemStorage]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
<no methods>
Static Methods:
<no static methods>
GENERATED_INHERITED_END
TEMPLATE_OPTIONS_START

View File

@ -90,12 +90,12 @@ class R3 {
/**
* static Version - Current R3 version
*/
R3.Version = '3.0.207';
R3.Version = '3.0.245';
/**
* static CompileDate - Current compile date of R3
*/
R3.CompileDate = '2021 Oct 02 - 06:27:56 am';
R3.CompileDate = '2021 Oct 02 - 10:26:44 am';
//GENERATED_STATIC_OPTIONS_INIT_END

View File

@ -1,79 +1 @@
let isReady = function(property, value) {
console.log('checking requirements for ' + property);
if (this.required[property] instanceof Array) {
/**
* First we need to check if we have this array defined
*/
if (!(value instanceof Array)) {
throw new Error('The property ' + property + ' of this object was not properly defined - it should be an array');
}
if (value.length === 0) {
return false;
}
/**
* Check all properties are an instance of this.required[property]
*/
for (let i = 0; i < value.length; i++) {
this.required[property].map(
function(constructor) {
if (!(value[i] instanceof constructor)) {
throw new Error('The property ' + property + ' of this object is not of the correct type');
}
}.bind(this)
);
}
for (let i = 0; i < value.length; i++) {
if (value[i].initialized !== true) {
return false;
}
}
return true;
} else {
if (value === null) {
return false;
} else {
if (typeof value === 'undefined') {
throw new Error('The ' + property + ' is not defined');
}
if (!(value instanceof this.required[property])) {
throw new Error('The property ' + property + ' of this object is not of the correct type')
}
if (value.initialized !== true) {
return false;
}
return true;
}
}
}.bind(this);
this.initialized = true;
for (let requiredProperty in this.required) {
if (this.required.hasOwnProperty(requiredProperty)) {
if (requiredProperty === property) {
if (!isReady(property, value)) {
this.initialized = false;
return;
}
} else {
if (!isReady(requiredProperty, this[requiredProperty])) {
this.initialized = false;
return;
}
}
}
}
this.initialized = true;

View File

@ -5,6 +5,7 @@
//CUSTOM_IMPORTS_END
const Component = require('../r3-component/r3-component.js');
const Event = require('../r3-event.js');
const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME');
/**

View File

@ -4,6 +4,7 @@
//CUSTOM_IMPORTS_START
//CUSTOM_IMPORTS_END
const Event = require('../r3-event.js');
const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME');
/**

View File

@ -1,7 +1,10 @@
/**
* KEY - COMMENT
*/
options.required.KEY = VALUE;
if (typeof options.required[INDEX] === 'undefined') {
options.required[INDEX] = {};
}
options.required[INDEX].KEY = VALUE;
this.KEYBackup = options.KEY;
Object.defineProperty(
this,
@ -13,7 +16,7 @@
Event.Emit(
Event.OBJECT_PROPERTY_UPDATE,
{
r3object : this,
r3Object : this,
property : 'KEY',
value : x
}
@ -22,7 +25,7 @@
Event.Emit(
Event.OBJECT_PROPERTY_UPDATED,
{
r3object : this,
r3Object : this,
property : 'KEY',
value : x
}

View File

@ -1,13 +1,5 @@
if (this.initializeDepth === this.maxDepth) {
if (this instanceof Component && this.initialized) {
this.createInstance();
}
if (this instanceof Entity && this.initialized && !this.started) {
this.start();
}
this.emit(Event.FINAL_INITIALIZE, this);
} else {
this.initializeDepth++;
}

View File

@ -21,7 +21,7 @@ const Utils = require('INCLUDE_PATH/r3-utils');
initializeDepth=0 - The amount of times this Object passed through initialize() functions
parents=[] - All Objects could have parent(s)
children=[] - All Objects could have some children
required={} - All Objects could have some required Objects which need to initialize before this Object can initialize
required=[Object] - All Objects could have some required Objects which need to initialize before this Object can initialize
TEMPLATE_OPTIONS_END
CUSTOM_OPTIONS_START

View File

@ -43,7 +43,9 @@ GENERATED_SET_RUNTIME_METHOD_AFTER
GENERATED_SOURCE
GENERATED_START_METHOD
GENERATED_START_METHOD_AFTER
GENERATED_STATIC_ACTIVATE_INSTANCES_METHOD
GENERATED_STATIC_ASYNC_METHOD
GENERATED_STATIC_DETERMINE_READY_STATE_METHOD
GENERATED_STATIC_EMIT_METHOD
GENERATED_STATIC_EVENT_LISTENER_METHODS
GENERATED_STATIC_EVENT_LISTENERS_START
@ -75,6 +77,8 @@ GENERATED_STATIC_ON_TOUCH_END_METHOD
GENERATED_STATIC_ON_TOUCH_MOVE_METHOD
GENERATED_STATIC_ON_TOUCH_START_METHOD
GENERATED_STATIC_OPTIONS_INIT
GENERATED_STATIC_SANITY_CHECKS_METHOD
GENERATED_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD
GENERATED_STATIC_START_METHOD
GENERATED_STATIC_STOP_METHOD
GENERATED_STATIC_SUBSCRIBE_METHOD
@ -127,7 +131,9 @@ CUSTOM_REQUIRED_COMPONENTS
CUSTOM_SET_INITIALIZED_METHOD
CUSTOM_SET_RUNTIME_METHOD
CUSTOM_START_METHOD
CUSTOM_STATIC_ACTIVATE_INSTANCES_METHOD
CUSTOM_STATIC_ASYNC_METHOD
CUSTOM_STATIC_DETERMINE_READY_STATE_METHOD
CUSTOM_STATIC_EMIT_METHOD
CUSTOM_STATIC_EVENT_LISTENERS
CUSTOM_STATIC_METHOD_NAME_UPPERCASE_METHOD
@ -157,6 +163,8 @@ CUSTOM_STATIC_ON_TOUCH_END_METHOD
CUSTOM_STATIC_ON_TOUCH_MOVE_METHOD
CUSTOM_STATIC_ON_TOUCH_START_METHOD
CUSTOM_STATIC_OPTIONS
CUSTOM_STATIC_SANITY_CHECKS_METHOD
CUSTOM_STATIC_SET_PARENT_CHILD_RELATIONSHIPS_METHOD
CUSTOM_STATIC_START_METHOD
CUSTOM_STATIC_STOP_METHOD
CUSTOM_STATIC_SUBSCRIBE_METHOD

View File

@ -133,15 +133,74 @@ describe('R3 Tests', () => {
);
it (
'Linking system calls createInstance() in the right order',
'Linking system sets parent / child relationships correctly',
() => {
const project = new Project();
const slider1 = new EntitySlider();
const canvas = new ComponentCanvas();
const slider = new EntitySlider();
const touch = new ComponentTouch();
const texture = new ComponentTexture();
const image1 = new ComponentImage();
const image2 = new ComponentImage();
const image3 = new ComponentImage();
// test normal assignment
slider1.canvas = canvas;
assert.deepEqual(canvas.parents, [slider1]);
assert.deepEqual(slider1.children, [canvas]);
assert.deepEqual(slider1.components, [canvas]);
slider1.images = [image1];
assert.deepEqual(image1.parents, [slider1]);
assert.deepEqual(slider1.children, [canvas, image1]);
assert.deepEqual(slider1.images, [image1]);
assert.deepEqual(slider1.components, [canvas, image1]);
// test assignment through constructor
const slider2 = new EntitySlider(
{
canvas : canvas,
images : [image1, image2]
}
)
assert.deepEqual(canvas.parents, [slider1, slider2]);
assert.deepEqual(image1.parents, [slider1, slider2]);
assert.deepEqual(image2.parents, [slider2]);
assert.deepEqual(slider2.images, [image1, image2]);
assert.deepEqual(slider2.children, [canvas, image1, image2]);
assert.deepEqual(slider2.components, [canvas, image1, image2]);
try {
const slider3 = new EntitySlider(
{
canvas: canvas,
images: null
}
)
} catch (err) {
assert.isTrue(err instanceof TypeError);
}
const slider3 = new EntitySlider({canvas});
slider3.images = [image1, image2, image3];
assert.deepEqual(image1.parents, [slider1, slider2, slider3]);
assert.deepEqual(slider3.children, [canvas, image1, image2, image3]);
assert.deepEqual(slider3.components, [canvas, image1, image2, image3]);
//test normal re-assignment
slider3.images = [image1, image3];
assert.deepEqual(image1.parents, [slider1, slider2, slider3]);
assert.deepEqual(slider3.children, [canvas, image1, image3]);
assert.deepEqual(slider3.components, [canvas, image1, image3]);
}
);

View File

@ -1 +1 @@
3.0.214
3.0.245