From 05089552ab020382882899167132679a9c671478 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Wed, 8 Sep 2021 23:08:15 +0200 Subject: [PATCH] re-introduce some methods for system templates --- .r3_history | 2 + dist/r3.js | 742 ++++++++++++++++++-------- package.json | 2 +- src/r3/r3-component/index.js | 2 - src/r3/r3-component/r3-canvas.js | 47 +- src/r3/r3-component/r3-component.js | 22 +- src/r3/r3-r3.js | 5 +- src/r3/r3-runtime/index.js | 5 + src/r3/r3-runtime/r3-d-o-m.js | 159 ++++++ src/r3/r3-runtime/r3-document.js | 177 ++++++ src/r3/r3-runtime/r3-runtime.js | 25 +- src/r3/r3-system/r3-system-d-o-m.js | 83 ++- src/r3/r3-system/r3-system-input.js | 23 +- src/r3/r3-system/r3-system-linking.js | 45 +- src/r3/r3-system/r3-system-socket.js | 45 +- src/r3/r3-system/r3-system.js | 17 + src/templates/get_runtime.template | 14 +- src/templates/system-base.template | 5 + src/templates/system.template | 8 + version | 2 +- 20 files changed, 1090 insertions(+), 340 deletions(-) create mode 100644 src/r3/r3-runtime/r3-d-o-m.js create mode 100644 src/r3/r3-runtime/r3-document.js diff --git a/.r3_history b/.r3_history index ca9a030..be8ffbc 100644 --- a/.r3_history +++ b/.r3_history @@ -27,3 +27,5 @@ r3 create Stats extends Statistics ./r3-runtime/ r3 create DOM extends Component ./r3-component/ r3 create Canvas extends DOM ./r3-component/ r3 create SystemDOM system +r3 create DOM extends Runtime ./r3-runtime/ +r3 create Document extends DOM ./r3-runtime/ diff --git a/dist/r3.js b/dist/r3.js index bb6a20e..5218e48 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.221'; - static compileDate = '2021 Sep 08 - 08:46:07 am'; + static version = '2.0.227'; + static compileDate = '2021 Sep 08 - 23:07:00 pm'; } /** @@ -44,6 +44,17 @@ class System { } + /** + * initialized() + * - No comment + */ + initialized() { + + Event.Emit(Event.OBJECT_INITIALIZED, this); + delete this.callDepth; + + } + } System.Started = false; @@ -1635,7 +1646,8 @@ class Utils { Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -1645,15 +1657,21 @@ class Utils { Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - + - start() + Starts a transient system by registering subscriptions to Events + + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -1663,6 +1681,9 @@ class Utils { - Stop() Stops the system by removing these subscriptions to events + Started=false + Subscriptions={} + **/ class SystemDOM extends System { @@ -1681,6 +1702,14 @@ class SystemDOM extends System { super(options); + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -1691,6 +1720,30 @@ class SystemDOM extends System { } + /** + * start() + * - Starts a transient system by registering subscriptions to Events + */ + start() { + + this.started = true; + + console.log('Started transient system: SystemDOM'); + + } + + /** + * stop() + * - Stops a transient system to by removing subscriptions to Events + */ + stop() { + + this.started = false; + + console.log('Stopped transient system: SystemDOM'); + + } + /** * Start() * - Starts the system by registering subscriptions to events @@ -1731,12 +1784,17 @@ class SystemDOM extends System { */ static OnDomComponentInitialized(object) { - console.log('DOM Component Created'); + console.log('DOM Component Initialized'); + + object.createInstance(); } } +SystemDOM.Started = false; +SystemDOM.Subscriptions = {}; + /** Class R3.System.Input @@ -1754,7 +1812,8 @@ class SystemDOM extends System { Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -1764,11 +1823,13 @@ class SystemDOM extends System { Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: @@ -1786,6 +1847,9 @@ class SystemDOM extends System { - Stop() Stops the system by removing these subscriptions to events + Started=false + Subscriptions={} + **/ class SystemInput extends System { @@ -1804,6 +1868,14 @@ class SystemInput extends System { super(options); + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -2046,6 +2118,9 @@ class SystemInput extends System { } +SystemInput.Started = false; +SystemInput.Subscriptions = {}; + /** Class R3.System.Linking @@ -2063,7 +2138,8 @@ class SystemInput extends System { Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -2073,19 +2149,21 @@ class SystemInput extends System { Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - - start(options) - Just calls System.Start(options) + - start() + Starts a transient system by registering subscriptions to Events - - stop(options) - Just calls System.Stop(options) + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -2095,6 +2173,9 @@ class SystemInput extends System { - Stop(options) Stops the system by removing these subscriptions to events + Started=false + Subscriptions={} + **/ class SystemLinking extends System { @@ -2113,6 +2194,14 @@ class SystemLinking extends System { super(options); + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -2125,10 +2214,9 @@ class SystemLinking extends System { /** * start() - * - Just calls System.Start(options) - * @param options + * - Starts a transient system by registering subscriptions to Events */ - start(options) { + start() { this.started = true; @@ -2138,10 +2226,9 @@ class SystemLinking extends System { /** * stop() - * - Just calls System.Stop(options) - * @param options + * - Stops a transient system to by removing subscriptions to Events */ - stop(options) { + stop() { this.started = false; @@ -2235,6 +2322,9 @@ class SystemLinking extends System { } +SystemLinking.Started = false; +SystemLinking.Subscriptions = {}; + /** Class R3.System.Socket @@ -2252,7 +2342,8 @@ class SystemLinking extends System { Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -2262,19 +2353,21 @@ class SystemLinking extends System { Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - - start(options) - Just calls System.Start(options) + - start() + Starts a transient system by registering subscriptions to Events - - stop(options) - Just calls System.Stop(options) + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -2284,6 +2377,9 @@ class SystemLinking extends System { - Stop(options) Stops the system by removing these subscriptions to events + Started=false + Subscriptions={} + **/ class SystemSocket extends System { @@ -2302,6 +2398,14 @@ class SystemSocket extends System { super(options); + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -2314,10 +2418,9 @@ class SystemSocket extends System { /** * start() - * - Just calls System.Start(options) - * @param options + * - Starts a transient system by registering subscriptions to Events */ - start(options) { + start() { this.started = true; @@ -2327,10 +2430,9 @@ class SystemSocket extends System { /** * stop() - * - Just calls System.Stop(options) - * @param options + * - Stops a transient system to by removing subscriptions to Events */ - stop(options) { + stop() { this.started = false; @@ -2368,6 +2470,9 @@ class SystemSocket extends System { } +SystemSocket.Started = false; +SystemSocket.Subscriptions = {}; + /** Class R3.Event.Runtime @@ -2457,17 +2562,20 @@ class Runtime extends Event { Runtime.CODER = 0x0; Runtime.CODE_MIRROR = 0x1; -Runtime.DEFAULT = 0x2; -Runtime.GUI = 0x3; -Runtime.CONTROL_KIT = 0x4; -Runtime.GRAPHICS = 0x5; -Runtime.THREE = 0x6; -Runtime.PHYSICS = 0x7; -Runtime.BULLET = 0x8; -Runtime.SOCKET = 0x9; -Runtime.STATISTICS = 0xa; -Runtime.STATS = 0xb; -Runtime.MAX_RUNTIMES = 0xc; +Runtime.DOM = 0x2; +Runtime.DOCUMENT = 0x3; +Runtime.CANVAS = 0x4; +Runtime.DEFAULT = 0x5; +Runtime.GUI = 0x6; +Runtime.CONTROL_KIT = 0x7; +Runtime.GRAPHICS = 0x8; +Runtime.THREE = 0x9; +Runtime.PHYSICS = 0xa; +Runtime.BULLET = 0xb; +Runtime.SOCKET = 0xc; +Runtime.STATISTICS = 0xd; +Runtime.STATS = 0xe; +Runtime.MAX_RUNTIMES = 0xf; /** @@ -2687,6 +2795,111 @@ class Coder extends Runtime { } +/** + + Class R3.Event.Runtime.DOM + [Inherited from Event] + + Inherited Properties: + + + + 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 Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to DOM] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class DOM extends Runtime { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialized(); + } else { + options.callDepth--; + } + + } + +} + /** Class R3.Event.Runtime.Default @@ -3518,24 +3731,23 @@ class Component extends R3Object { */ getRuntime() { - if (this.runtime === R3.Runtime.DEFAULT) { - //TODO: implement runtime base - return null; - } - - //TODO: implement runtime classes - return null; + this.emit( + Event.GET_RUNTIME, + this, + function(runtime) { + this.runtime = runtime; + }.bind(this) + ) } } Component.DOM = 0x0; -Component.CANVAS = 0x1; -Component.IMAGE = 0x2; -Component.INPUT = 0x3; -Component.TOUCH = 0x4; -Component.MAX_COMPONENTS = 0x5; +Component.IMAGE = 0x1; +Component.INPUT = 0x2; +Component.TOUCH = 0x3; +Component.MAX_COMPONENTS = 0x4; /** @@ -3768,6 +3980,252 @@ class CodeMirror extends Coder { } +/** + + Class R3.Event.Runtime.DOM.Document + [Inherited from Event] + + Inherited Properties: + + + + 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 Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from DOM] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to Document] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class Document extends DOM { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialized(); + } else { + options.callDepth--; + } + + } + +} + +/** + + Class R3.Event.Runtime.DOM.Canvas + [Inherited from Event] + + Inherited Properties: + + + + 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 Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from DOM] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to Canvas] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class Canvas extends DOM { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialized(); + } else { + options.callDepth--; + } + + } + +} + /** Class R3.Event.Runtime.GUI.ControlKit @@ -4704,168 +5162,6 @@ class Input extends Component { } -/** - - Class R3.Event.Object.Component.DOM.Canvas - [Inherited from Event] - - Inherited Properties: - - - - 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: - - - id (Default value Utils.RandomId(10)) - - name (Default value 'Object ' + options.id) - - register (Default value true) - - Inherited Static Properties: - - - - Inherited Methods: - - - initialized() - Emits an event which indicates that this object instance is ready to be created - - Inherited Static Methods: - - - - [Inherited from Component] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialized() - In addition to firing an Event.OBJECT_INITIALIZED it also fires an Event.COMPONENT_INITIALIZED - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - updateFromInstance() - Updates this object by copying the values of its instance into the current object. - - - getRuntime() - Gets the current runtime object - - Inherited Static Methods: - - - - [Inherited from DOM] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialized() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an - Event.DOM_COMPONENT_INITIALIZED - - Inherited Static Methods: - - - - [Belonging to Canvas] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class Canvas extends DOM { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialized(); - } else { - options.callDepth--; - } - - } - -} - /** Class R3.Event.Object.Component.Input.Touch @@ -5034,7 +5330,6 @@ R3.Object = R3Object; R3.Component = Component; R3.Project = Project; R3.DOM = DOM; -R3.Canvas = Canvas; R3.Image = Image; R3.Input = Input; R3.Touch = Touch; @@ -5043,12 +5338,13 @@ System.Input = SystemInput; System.Linking = SystemLinking; System.Socket = SystemSocket; Component.DOM = DOM; -Component.DOM.Canvas = Canvas; Component.Image = Image; Component.Input = Input; Component.Input.Touch = Touch; Runtime.Coder = Coder; Runtime.Coder.CodeMirror = CodeMirror; +Runtime.DOM = DOM; +Runtime.DOM.Document = Document; Runtime.Default = Default; Runtime.GUI = GUI; Runtime.GUI.ControlKit = ControlKit; diff --git a/package.json b/package.json index c371609..4c8da81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.221", + "version" : "2.0.227", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component/index.js b/src/r3/r3-component/index.js index 85f72f8..0498c8e 100644 --- a/src/r3/r3-component/index.js +++ b/src/r3/r3-component/index.js @@ -1,7 +1,6 @@ //GENERATED_IMPORTS_START const Component = require('./r3-component.js'); const DOM = require('./r3-d-o-m.js'); -const Canvas = require('./r3-canvas.js'); const Image = require('./r3-image.js'); const Input = require('./r3-input.js'); const Touch = require('./r3-touch.js'); @@ -9,7 +8,6 @@ const Touch = require('./r3-touch.js'); //GENERATED_INDEX_BODY_START Component.DOM = DOM; -Component.DOM.Canvas = Canvas; Component.Image = Image; Component.Input = Input; Component.Input.Touch = Touch; diff --git a/src/r3/r3-component/r3-canvas.js b/src/r3/r3-component/r3-canvas.js index 582e6aa..c8ca770 100644 --- a/src/r3/r3-component/r3-canvas.js +++ b/src/r3/r3-component/r3-canvas.js @@ -6,7 +6,7 @@ const DOM = require('.././r3-d-o-m.js'); GENERATED_INHERITED_START - Class R3.Event.Object.Component.DOM.Canvas + Class R3.Event.Runtime.DOM.Canvas [Inherited from Event] Inherited Properties: @@ -43,28 +43,7 @@ const DOM = require('.././r3-d-o-m.js'); - Subscribe(eventId, callback) Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - [Inherited from R3Object] - - Inherited Properties: - - - id (Default value Utils.RandomId(10)) - - name (Default value 'Object ' + options.id) - - register (Default value true) - - Inherited Static Properties: - - - - Inherited Methods: - - - initialized() - Emits an event which indicates that this object instance is ready to be created - - Inherited Static Methods: - - - - [Inherited from Component] + [Inherited from Runtime] Inherited Properties: @@ -76,23 +55,7 @@ const DOM = require('.././r3-d-o-m.js'); Inherited Methods: - - initialized() - In addition to firing an Event.OBJECT_INITIALIZED it also fires an Event.COMPONENT_INITIALIZED - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - updateFromInstance() - Updates this object by copying the values of its instance into the current object. - - - getRuntime() - Gets the current runtime object + Inherited Static Methods: @@ -110,9 +73,7 @@ const DOM = require('.././r3-d-o-m.js'); Inherited Methods: - - initialized() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an - Event.DOM_COMPONENT_INITIALIZED + Inherited Static Methods: diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index 98086e6..cf2234c 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -277,13 +277,14 @@ class Component extends R3Object { getRuntime() { //GENERATED_GET_RUNTIME_METHOD_START - if (this.runtime === R3.Runtime.DEFAULT) { - //TODO: implement runtime base - return null; - } + this.emit( + Event.GET_RUNTIME, + this, + function(runtime) { + this.runtime = runtime; + }.bind(this) + ) - //TODO: implement runtime classes - return null; //GENERATED_GET_RUNTIME_METHOD_END //CUSTOM_GET_RUNTIME_METHOD_START @@ -301,11 +302,10 @@ class Component extends R3Object { //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START Component.DOM = 0x0; -Component.CANVAS = 0x1; -Component.IMAGE = 0x2; -Component.INPUT = 0x3; -Component.TOUCH = 0x4; -Component.MAX_COMPONENTS = 0x5; +Component.IMAGE = 0x1; +Component.INPUT = 0x2; +Component.TOUCH = 0x3; +Component.MAX_COMPONENTS = 0x4; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 1eaef2b..1112741 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.221'; - static compileDate = '2021 Sep 08 - 08:46:07 am'; + static version = '2.0.227'; + static compileDate = '2021 Sep 08 - 23:07:00 pm'; } //GENERATED_IMPORTS_START @@ -22,7 +22,6 @@ R3.Object = R3Object; R3.Component = Component; R3.Project = Project; R3.DOM = DOM; -R3.Canvas = Canvas; R3.Image = Image; R3.Input = Input; R3.Touch = Touch; diff --git a/src/r3/r3-runtime/index.js b/src/r3/r3-runtime/index.js index 8575afa..a4a1629 100644 --- a/src/r3/r3-runtime/index.js +++ b/src/r3/r3-runtime/index.js @@ -2,6 +2,9 @@ const Runtime = require('./r3-runtime.js'); const Coder = require('./r3-coder.js'); const CodeMirror = require('./r3-code-mirror.js'); +const DOM = require('./r3-d-o-m.js'); +const Document = require('./r3-document.js'); +const Canvas = require('src/r3/r3-component/r3-canvas.js'); const Default = require('./r3-default.js'); const GUI = require('./r3-g-u-i.js'); const ControlKit = require('./r3-control-kit.js'); @@ -17,6 +20,8 @@ const Stats = require('./r3-stats.js'); //GENERATED_INDEX_BODY_START Runtime.Coder = Coder; Runtime.Coder.CodeMirror = CodeMirror; +Runtime.DOM = DOM; +Runtime.DOM.Document = Document; Runtime.Default = Default; Runtime.GUI = GUI; Runtime.GUI.ControlKit = ControlKit; diff --git a/src/r3/r3-runtime/r3-d-o-m.js b/src/r3/r3-runtime/r3-d-o-m.js new file mode 100644 index 0000000..094df47 --- /dev/null +++ b/src/r3/r3-runtime/r3-d-o-m.js @@ -0,0 +1,159 @@ +const Event = require('.././r3-event'); +const Utils = require('.././r3-utils'); +const Runtime = require('.././r3-runtime.js'); + +/** + + GENERATED_INHERITED_START + + Class R3.Event.Runtime.DOM + [Inherited from Event] + + Inherited Properties: + + + + 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 Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to DOM] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + GENERATED_INHERITED_END + + CUSTOM_OPTIONS_START + CUSTOM_OPTIONS_END + + CUSTOM_INSTANCE_OPTIONS_MAPPING_START + CUSTOM_INSTANCE_OPTIONS_MAPPING_END + + CUSTOM_LINKED_OBJECTS_START + CUSTOM_LINKED_OBJECTS_END + + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + CUSTOM_METHODS_START + CUSTOM_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + + **/ + +class DOM extends Runtime { + + //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + //CUSTOM_OPTIONS_INIT_START + //CUSTOM_OPTIONS_INIT_END + + Object.assign(this, options); + + //CUSTOM_BEFORE_INIT_START + //CUSTOM_BEFORE_INIT_END + + if (options.callDepth === 0) { + this.initialized(); + } else { + options.callDepth--; + } + + //CUSTOM_AFTER_INIT_START + //CUSTOM_AFTER_INIT_END + } + //GENERATED_CONSTRUCTOR_EXTENDS_END + + //GENERATED_METHODS_START + //GENERATED_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END +} + +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END + +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END + +module.exports = DOM; diff --git a/src/r3/r3-runtime/r3-document.js b/src/r3/r3-runtime/r3-document.js new file mode 100644 index 0000000..7d75203 --- /dev/null +++ b/src/r3/r3-runtime/r3-document.js @@ -0,0 +1,177 @@ +const Event = require('.././r3-event'); +const Utils = require('.././r3-utils'); +const DOM = require('.././r3-d-o-m.js'); + +/** + + GENERATED_INHERITED_START + + Class R3.Event.Runtime.DOM.Document + [Inherited from Event] + + Inherited Properties: + + + + 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 Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from DOM] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to Document] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + GENERATED_INHERITED_END + + CUSTOM_OPTIONS_START + CUSTOM_OPTIONS_END + + CUSTOM_INSTANCE_OPTIONS_MAPPING_START + CUSTOM_INSTANCE_OPTIONS_MAPPING_END + + CUSTOM_LINKED_OBJECTS_START + CUSTOM_LINKED_OBJECTS_END + + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + CUSTOM_METHODS_START + CUSTOM_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + + **/ + +class Document extends DOM { + + //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + //CUSTOM_OPTIONS_INIT_START + //CUSTOM_OPTIONS_INIT_END + + Object.assign(this, options); + + //CUSTOM_BEFORE_INIT_START + //CUSTOM_BEFORE_INIT_END + + if (options.callDepth === 0) { + this.initialized(); + } else { + options.callDepth--; + } + + //CUSTOM_AFTER_INIT_START + //CUSTOM_AFTER_INIT_END + } + //GENERATED_CONSTRUCTOR_EXTENDS_END + + //GENERATED_METHODS_START + //GENERATED_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END +} + +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END + +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END + +module.exports = Document; diff --git a/src/r3/r3-runtime/r3-runtime.js b/src/r3/r3-runtime/r3-runtime.js index 0c055a6..5e0dc64 100644 --- a/src/r3/r3-runtime/r3-runtime.js +++ b/src/r3/r3-runtime/r3-runtime.js @@ -134,17 +134,20 @@ class Runtime extends Event { //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START Runtime.CODER = 0x0; Runtime.CODE_MIRROR = 0x1; -Runtime.DEFAULT = 0x2; -Runtime.GUI = 0x3; -Runtime.CONTROL_KIT = 0x4; -Runtime.GRAPHICS = 0x5; -Runtime.THREE = 0x6; -Runtime.PHYSICS = 0x7; -Runtime.BULLET = 0x8; -Runtime.SOCKET = 0x9; -Runtime.STATISTICS = 0xa; -Runtime.STATS = 0xb; -Runtime.MAX_RUNTIMES = 0xc; +Runtime.DOM = 0x2; +Runtime.DOCUMENT = 0x3; +Runtime.CANVAS = 0x4; +Runtime.DEFAULT = 0x5; +Runtime.GUI = 0x6; +Runtime.CONTROL_KIT = 0x7; +Runtime.GRAPHICS = 0x8; +Runtime.THREE = 0x9; +Runtime.PHYSICS = 0xa; +Runtime.BULLET = 0xb; +Runtime.SOCKET = 0xc; +Runtime.STATISTICS = 0xd; +Runtime.STATS = 0xe; +Runtime.MAX_RUNTIMES = 0xf; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system-d-o-m.js b/src/r3/r3-system/r3-system-d-o-m.js index 23a238c..6f3045c 100644 --- a/src/r3/r3-system/r3-system-d-o-m.js +++ b/src/r3/r3-system/r3-system-d-o-m.js @@ -21,7 +21,8 @@ const System = require('./r3-system.js'); Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -31,15 +32,21 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - + - start() + Starts a transient system by registering subscriptions to Events + + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -52,9 +59,13 @@ const System = require('./r3-system.js'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -65,6 +76,8 @@ const System = require('./r3-system.js'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START + start() - Starts a transient system by registering subscriptions to Events + stop() - Stops a transient system to by removing subscriptions to Events CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -92,6 +105,14 @@ class SystemDOM extends System { super(options); //GENERATED_OPTIONS_INIT_START + + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -114,6 +135,54 @@ class SystemDOM extends System { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * start() + * - Starts a transient system by registering subscriptions to Events + */ + start() { + + //GENERATED_START_METHOD_START + + //GENERATED_EVENT_LISTENERS_START_START + //GENERATED_EVENT_LISTENERS_START_END + + //CUSTOM_BEFORE_SYSTEM_START_START + //CUSTOM_BEFORE_SYSTEM_START_END + + this.started = true; + + console.log('Started transient system: SystemDOM'); + //GENERATED_START_METHOD_END + + //CUSTOM_START_METHOD_START + //CUSTOM_START_METHOD_END + + } + + /** + * stop() + * - Stops a transient system to by removing subscriptions to Events + */ + stop() { + + //GENERATED_STOP_METHOD_START + + //GENERATED_EVENT_LISTENERS_STOP_START + //GENERATED_EVENT_LISTENERS_STOP_END + + //CUSTOM_BEFORE_SYSTEM_STOP_START + //CUSTOM_BEFORE_SYSTEM_STOP_END + + this.started = false; + + console.log('Stopped transient system: SystemDOM'); + //GENERATED_STOP_METHOD_END + + //CUSTOM_STOP_METHOD_START + //CUSTOM_STOP_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START @@ -194,7 +263,9 @@ class SystemDOM extends System { //GENERATED_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END //CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_START - console.log('DOM Component Created'); + console.log('DOM Component Initialized'); + + object.createInstance(); //CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END } @@ -206,6 +277,8 @@ class SystemDOM extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +SystemDOM.Started = false; +SystemDOM.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index 89c69d1..eb7a00e 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -21,7 +21,8 @@ const System = require('./r3-system.js'); Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -31,11 +32,13 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: @@ -56,9 +59,13 @@ const System = require('./r3-system.js'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -107,6 +114,14 @@ class SystemInput extends System { super(options); //GENERATED_OPTIONS_INIT_START + + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -485,6 +500,8 @@ class SystemInput extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +SystemInput.Started = false; +SystemInput.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index 8e95c79..f0cae64 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -21,7 +21,8 @@ const System = require('./r3-system.js'); Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -31,19 +32,21 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - - start(options) - Just calls System.Start(options) + - start() + Starts a transient system by registering subscriptions to Events - - stop(options) - Just calls System.Stop(options) + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -56,9 +59,13 @@ const System = require('./r3-system.js'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -71,8 +78,8 @@ const System = require('./r3-system.js'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START - start(options) - Just calls System.Start(options) - stop(options) - Just calls System.Stop(options) + start() - Starts a transient system by registering subscriptions to Events + stop() - Stops a transient system to by removing subscriptions to Events CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -100,6 +107,14 @@ class SystemLinking extends System { super(options); //GENERATED_OPTIONS_INIT_START + + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -125,10 +140,9 @@ class SystemLinking extends System { /** * start() - * - Just calls System.Start(options) - * @param options + * - Starts a transient system by registering subscriptions to Events */ - start(options) { + start() { //GENERATED_START_METHOD_START @@ -150,10 +164,9 @@ class SystemLinking extends System { /** * stop() - * - Just calls System.Stop(options) - * @param options + * - Stops a transient system to by removing subscriptions to Events */ - stop(options) { + stop() { //GENERATED_STOP_METHOD_START @@ -315,6 +328,8 @@ class SystemLinking extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +SystemLinking.Started = false; +SystemLinking.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system-socket.js b/src/r3/r3-system/r3-system-socket.js index 9489168..566209e 100644 --- a/src/r3/r3-system/r3-system-socket.js +++ b/src/r3/r3-system/r3-system-socket.js @@ -21,7 +21,8 @@ const System = require('./r3-system.js'); Inherited Methods: - + - initialized() + No comment Inherited Static Methods: @@ -31,19 +32,21 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) + - subscriptions (Default value {}) Static Properties: - + - Started (Default value false) + - Subscriptions (Default value {}) Methods: - - start(options) - Just calls System.Start(options) + - start() + Starts a transient system by registering subscriptions to Events - - stop(options) - Just calls System.Stop(options) + - stop() + Stops a transient system to by removing subscriptions to Events Static Methods: @@ -56,9 +59,13 @@ const System = require('./r3-system.js'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -68,8 +75,8 @@ const System = require('./r3-system.js'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START - start(options) - Just calls System.Start(options) - stop(options) - Just calls System.Stop(options) + start() - Starts a transient system by registering subscriptions to Events + stop() - Stops a transient system to by removing subscriptions to Events CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -97,6 +104,14 @@ class SystemSocket extends System { super(options); //GENERATED_OPTIONS_INIT_START + + if (typeof options.started === 'undefined') { + options.started = false; + } + + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -122,10 +137,9 @@ class SystemSocket extends System { /** * start() - * - Just calls System.Start(options) - * @param options + * - Starts a transient system by registering subscriptions to Events */ - start(options) { + start() { //GENERATED_START_METHOD_START @@ -147,10 +161,9 @@ class SystemSocket extends System { /** * stop() - * - Just calls System.Stop(options) - * @param options + * - Stops a transient system to by removing subscriptions to Events */ - stop(options) { + stop() { //GENERATED_STOP_METHOD_START @@ -240,6 +253,8 @@ class SystemSocket extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +SystemSocket.Started = false; +SystemSocket.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index d7c3a68..b3cc3ec 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -20,6 +20,7 @@ const Utils = require('.././r3-utils'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START + initialized() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -75,6 +76,22 @@ class System { //GENERATED_CONSTRUCTOR_END //GENERATED_METHODS_START + + /** + * initialized() + * - No comment + */ + initialized() { + + //GENERATED_INITIALIZED_METHOD_START + Event.Emit(Event.OBJECT_INITIALIZED, this); + delete this.callDepth; + //GENERATED_INITIALIZED_METHOD_END + + //CUSTOM_INITIALIZED_METHOD_START + //CUSTOM_INITIALIZED_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/templates/get_runtime.template b/src/templates/get_runtime.template index cb2ce7a..3af5ea9 100644 --- a/src/templates/get_runtime.template +++ b/src/templates/get_runtime.template @@ -1,7 +1,7 @@ - if (this.runtime === R3.Runtime.DEFAULT) { - //TODO: implement runtime base - return null; - } - - //TODO: implement runtime classes - return null; \ No newline at end of file + this.emit( + Event.GET_RUNTIME, + this, + function(runtime) { + this.runtime = runtime; + }.bind(this) + ) diff --git a/src/templates/system-base.template b/src/templates/system-base.template index 769f32d..f8753ec 100644 --- a/src/templates/system-base.template +++ b/src/templates/system-base.template @@ -4,9 +4,13 @@ const Utils = require('INCLUDE_PATH/r3-utils'); /** CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -16,6 +20,7 @@ const Utils = require('INCLUDE_PATH/r3-utils'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START + initialized() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START diff --git a/src/templates/system.template b/src/templates/system.template index c5d5660..9542af8 100644 --- a/src/templates/system.template +++ b/src/templates/system.template @@ -9,9 +9,13 @@ const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + started=false + subscriptions={} CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false + Subscriptions={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -21,9 +25,13 @@ const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START + start() - Starts a transient system by registering subscriptions to Events + stop() - Stops a transient system to by removing subscriptions to Events CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START + Start(options) - Starts the system by registering subscriptions to events + Stop(options) - Stops the system by removing these subscriptions to events CUSTOM_STATIC_METHODS_END **/ diff --git a/version b/version index 7fbdaa8..77a8c9c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.221 \ No newline at end of file +2.0.227 \ No newline at end of file