From d4c5e23f3a2294e267dfb656e13e8cd943502273 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Fri, 10 Sep 2021 14:03:19 +0200 Subject: [PATCH] each one for his own --- dist/r3.js | 2642 +++++++----------- package.json | 2 +- src/r3/r3-component/r3-component-canvas.js | 49 +- src/r3/r3-component/r3-component-image.js | 49 +- src/r3/r3-component/r3-component-material.js | 49 +- src/r3/r3-component/r3-component-mesh.js | 49 +- src/r3/r3-component/r3-component-texture.js | 49 +- src/r3/r3-component/r3-component-touch.js | 49 +- src/r3/r3-event.js | 44 +- src/r3/r3-r3.js | 8 +- src/r3/r3-runtime/index.js | 4 +- src/r3/r3-runtime/r3-runtime-bullet.js | 63 + src/r3/r3-runtime/r3-runtime-code-mirror.js | 82 + src/r3/r3-runtime/r3-runtime-coder.js | 63 + src/r3/r3-runtime/r3-runtime-control-kit.js | 82 + src/r3/r3-runtime/r3-runtime-d-o-m.js | 63 + src/r3/r3-runtime/r3-runtime-default.js | 41 +- src/r3/r3-runtime/r3-runtime-document.js | 82 + src/r3/r3-runtime/r3-runtime-g-u-i.js | 63 + src/r3/r3-runtime/r3-runtime-graphics.js | 63 + src/r3/r3-runtime/r3-runtime-physics.js | 63 + src/r3/r3-runtime/r3-runtime-socket.js | 63 + src/r3/r3-runtime/r3-runtime-statistics.js | 63 + src/r3/r3-runtime/r3-runtime-stats.js | 82 + src/r3/r3-runtime/r3-runtime-three.js | 82 + src/r3/r3-runtime/r3-runtime.js | 18 + src/r3/r3-system/r3-system-d-o-m.js | 5 +- src/r3/r3-system/r3-system-input.js | 3 +- src/r3/r3-system/r3-system-linking.js | 3 +- src/r3/r3-system/r3-system-runtime.js | 60 +- src/r3/r3-system/r3-system-socket.js | 3 +- src/r3/r3-system/r3-system.js | 26 + src/templates/system_extends.template | 9 + src/templates/token.db | 4 + version | 2 +- 35 files changed, 2424 insertions(+), 1658 deletions(-) diff --git a/dist/r3.js b/dist/r3.js index 8c51cfe..9a40e35 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.522'; - static compileDate = '2021 Sep 10 - 11:12:39 am'; + static version = '2.0.533'; + static compileDate = '2021 Sep 10 - 14:01:56 pm'; } class Entity { @@ -52,6 +52,30 @@ class Entity { Entity.ENTITY_SLIDER = 0x0; Entity.MAX_ENTITY = 0x1; +class Runtime { + + constructor() { + + } + +} + +Runtime.RUNTIME_BULLET = 0x0; +Runtime.RUNTIME_CODER = 0x1; +Runtime.RUNTIME_CODE_MIRROR = 0x2; +Runtime.RUNTIME_DOM = 0x3; +Runtime.RUNTIME_DOCUMENT = 0x4; +Runtime.RUNTIME_DEFAULT = 0x5; +Runtime.RUNTIME_GUI = 0x6; +Runtime.RUNTIME_CONTROL_KIT = 0x7; +Runtime.RUNTIME_GRAPHICS = 0x8; +Runtime.RUNTIME_THREE = 0x9; +Runtime.RUNTIME_PHYSICS = 0xa; +Runtime.RUNTIME_SOCKET = 0xb; +Runtime.RUNTIME_STATISTICS = 0xc; +Runtime.RUNTIME_STATS = 0xd; +Runtime.MAX_RUNTIME = 0xe; + class System { constructor(options) { @@ -351,16 +375,19 @@ Event.MOUSE_WHEEL = 0x14; Event.OBJECT_CREATED = 0x15; Event.OBJECT_INITIALIZED = 0x16; Event.PAUSE = 0x17; -Event.PROJECT_INITIALIZED = 0x18; -Event.RESTART = 0x19; -Event.START = 0x1a; -Event.TOUCH_CANCEL = 0x1b; -Event.TOUCH_END = 0x1c; -Event.TOUCH_MOVE = 0x1d; -Event.TOUCH_START = 0x1e; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x1f; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x20; -Event.MAX_EVENTS = 0x21; +Event.PROJECT_CREATED = 0x18; +Event.PROJECT_INITIALIZED = 0x19; +Event.RESTART = 0x1a; +Event.START = 0x1b; +Event.TOUCH_CANCEL = 0x1c; +Event.TOUCH_END = 0x1d; +Event.TOUCH_MOVE = 0x1e; +Event.TOUCH_START = 0x1f; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x20; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x21; +Event.UPDATE_INSTANCE_AFTER = 0x22; +Event.UPDATE_INSTANCE_BEFORE = 0x23; +Event.MAX_EVENTS = 0x24; Event.GetEventName = function(eventId) { @@ -388,15 +415,18 @@ Event.GetEventName = function(eventId) { case 0x15 : return 'object_created'; case 0x16 : return 'object_initialized'; case 0x17 : return 'pause'; - case 0x18 : return 'project_initialized'; - case 0x19 : return 'restart'; - case 0x1a : return 'start'; - case 0x1b : return 'touch_cancel'; - case 0x1c : return 'touch_end'; - case 0x1d : return 'touch_move'; - case 0x1e : return 'touch_start'; - case 0x1f : return 'update_from_instance_after'; - case 0x20 : return 'update_from_instance_before'; + case 0x18 : return 'project_created'; + case 0x19 : return 'project_initialized'; + case 0x1a : return 'restart'; + case 0x1b : return 'start'; + case 0x1c : return 'touch_cancel'; + case 0x1d : return 'touch_end'; + case 0x1e : return 'touch_move'; + case 0x1f : return 'touch_start'; + case 0x20 : return 'update_from_instance_after'; + case 0x21 : return 'update_from_instance_before'; + case 0x22 : return 'update_instance_after'; + case 0x23 : return 'update_instance_before'; default : throw new Error('Event type not defined : ' + eventId); } @@ -1750,6 +1780,615 @@ class EntitySlider extends Entity { } +/** + + Class R3.Runtime.Bullet + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeBullet] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeBullet extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Coder + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeCoder] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeCoder extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.DOM + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeDOM] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeDOM extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Default + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeDefault] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class RuntimeDefault extends Runtime { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.initialized === 'undefined') { + options.initialized = false; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + } + +} + +/** + + Class R3.Runtime.GUI + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeGUI] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeGUI extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Graphics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeGraphics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeGraphics extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Physics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimePhysics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimePhysics extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Socket + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeSocket] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeSocket extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + +/** + + Class R3.Runtime.Statistics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeStatistics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + + **/ + +class RuntimeStatistics extends Runtime { + + constructor() { + super(); + } + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + + } + +} + /** Class R3.System.DOM @@ -1853,8 +2492,6 @@ class SystemDOM extends System { */ static OnDomComponentInitialized(object) { - console.log('DOM Component Initialized'); - object.createInstance(); } @@ -2319,6 +2956,14 @@ SystemLinking.Subscriptions = {}; - Started (Default value false) - Subscriptions (Default value {}) + - 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: @@ -2334,6 +2979,14 @@ SystemLinking.Subscriptions = {}; Started=false Subscriptions={} + Projects=[] + CurrentProject=null + RuntimeCoder={} + RuntimeDOM={} + RuntimeGUI={} + RuntimeGraphics={} + RuntimePhysics={} + RuntimeStatistics={} **/ @@ -2363,6 +3016,11 @@ class SystemRuntime extends System { SystemRuntime.OnGetRuntime ); + SystemRuntime.Subscriptions['PROJECT_CREATED'] = Event.Subscribe( + Event.PROJECT_CREATED, + SystemRuntime.OnProjectCreated + ); + SystemRuntime.Started = true; console.log('Started system: SystemRuntime'); @@ -2379,6 +3037,9 @@ class SystemRuntime extends System { SystemRuntime.Subscriptions['GET_RUNTIME'].remove(); delete SystemRuntime.Subscriptions['GET_RUNTIME']; + SystemRuntime.Subscriptions['PROJECT_CREATED'].remove(); + delete SystemRuntime.Subscriptions['PROJECT_CREATED']; + SystemRuntime.Started = false; console.log('Stopped system: SystemRuntime'); @@ -2394,15 +3055,40 @@ class SystemRuntime extends System { static OnGetRuntime(object) { if (object instanceof R3.Component.DOM) { - + if (SystemRuntime.CurrentProject === null) { + console.log('There currently is no active project - using the default DOM runtime'); + } else { + console.log('TODO: implement a project based DOM runtime'); + } } } + /** + * OnProjectCreated() + * - Listens to events of type Event.PROJECT_CREATED and executes this function. + * @param object (The event data passed as argument - typically an R3Object) + * @return null + */ + static OnProjectCreated(object) { + + Utils.PushUnique(SystemRuntime.Projects, object); + SystemRuntime.CurrentProject = object; + + } + } SystemRuntime.Started = false; SystemRuntime.Subscriptions = {}; +SystemRuntime.Projects = []; +SystemRuntime.CurrentProject = null; +SystemRuntime.RuntimeCoder = {}; +SystemRuntime.RuntimeDOM = {}; +SystemRuntime.RuntimeGUI = {}; +SystemRuntime.RuntimeGraphics = {}; +SystemRuntime.RuntimePhysics = {}; +SystemRuntime.RuntimeStatistics = {}; /** @@ -2498,116 +3184,6 @@ class SystemSocket extends System { SystemSocket.Started = false; SystemSocket.Subscriptions = {}; -/** - - Class R3.Event.Runtime - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 Runtime] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class Runtime extends Event { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -Runtime.RUNTIME_CODER = 0x0; -Runtime.RUNTIME_CODE_MIRROR = 0x1; -Runtime.RUNTIME_DOM = 0x2; -Runtime.RUNTIME_DOCUMENT = 0x3; -Runtime.RUNTIME_DEFAULT = 0x4; -Runtime.RUNTIME_GUI = 0x5; -Runtime.RUNTIME_CONTROL_KIT = 0x6; -Runtime.RUNTIME_GRAPHICS = 0x7; -Runtime.RUNTIME_THREE = 0x8; -Runtime.RUNTIME_PHYSICS = 0x9; -Runtime.RUNTIME_BULLET = 0xa; -Runtime.RUNTIME_SOCKET = 0xb; -Runtime.RUNTIME_STATISTICS = 0xc; -Runtime.RUNTIME_STATS = 0xd; -Runtime.MAX_RUNTIME = 0xe; - /** Class R3.Event.Object @@ -2736,46 +3312,7 @@ class R3Object extends Event { /** - Class R3.Event.Runtime.Coder - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.Coder.CodeMirror [Inherited from Runtime] Inherited Properties: @@ -2794,7 +3331,26 @@ class R3Object extends Event { - [Belonging to RuntimeCoder] + [Inherited from RuntimeCoder] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeCodeMirror] Properties: @@ -2806,7 +3362,8 @@ class R3Object extends Event { Methods: - + - createInstance(component) + Overrides for R3.Runtime.RuntimeCoder.createInstance() Static Methods: @@ -2814,33 +3371,26 @@ class R3Object extends Event { **/ -class RuntimeCoder extends Runtime { +class RuntimeCodeMirror extends RuntimeCoder { - constructor(options) { + constructor() { + super(); + } - if (typeof options === 'undefined') { - options = {}; - } + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } + this.emit(Event.CREATE_INSTANCE_BEFORE, this); - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } + this.setRuntime(); - super(options); + this.runtime.createInstance(this); - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } + this.emit(Event.INSTANCE_CREATED, this); } @@ -2848,46 +3398,7 @@ class RuntimeCoder extends Runtime { /** - Class R3.Event.Runtime.DOM - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.DOM.Document [Inherited from Runtime] Inherited Properties: @@ -2906,7 +3417,26 @@ class RuntimeCoder extends Runtime { - [Belonging to RuntimeDOM] + [Inherited from RuntimeDOM] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeDocument] Properties: @@ -2918,7 +3448,8 @@ class RuntimeCoder extends Runtime { Methods: - + - createInstance(component) + Overrides for R3.Runtime.RuntimeDOM.createInstance() Static Methods: @@ -2926,33 +3457,26 @@ class RuntimeCoder extends Runtime { **/ -class RuntimeDOM extends Runtime { +class RuntimeDocument extends RuntimeDOM { - constructor(options) { + constructor() { + super(); + } - if (typeof options === 'undefined') { - options = {}; - } + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } + this.emit(Event.CREATE_INSTANCE_BEFORE, this); - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } + this.setRuntime(); - super(options); + this.runtime.createInstance(this); - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } + this.emit(Event.INSTANCE_CREATED, this); } @@ -2960,46 +3484,7 @@ class RuntimeDOM extends Runtime { /** - Class R3.Event.Runtime.Default - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.GUI.ControlKit [Inherited from Runtime] Inherited Properties: @@ -3018,7 +3503,26 @@ class RuntimeDOM extends Runtime { - [Belonging to RuntimeDefault] + [Inherited from RuntimeGUI] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeControlKit] Properties: @@ -3030,7 +3534,8 @@ class RuntimeDOM extends Runtime { Methods: - + - createInstance(component) + Overrides for R3.Runtime.RuntimeGUI.createInstance() Static Methods: @@ -3038,33 +3543,26 @@ class RuntimeDOM extends Runtime { **/ -class RuntimeDefault extends Runtime { +class RuntimeControlKit extends RuntimeGUI { - constructor(options) { + constructor() { + super(); + } - if (typeof options === 'undefined') { - options = {}; - } + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } + this.emit(Event.CREATE_INSTANCE_BEFORE, this); - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } + this.setRuntime(); - super(options); + this.runtime.createInstance(this); - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } + this.emit(Event.INSTANCE_CREATED, this); } @@ -3072,46 +3570,7 @@ class RuntimeDefault extends Runtime { /** - Class R3.Event.Runtime.GUI - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.Graphics.Three [Inherited from Runtime] Inherited Properties: @@ -3130,7 +3589,26 @@ class RuntimeDefault extends Runtime { - [Belonging to RuntimeGUI] + [Inherited from RuntimeGraphics] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeThree] Properties: @@ -3142,7 +3620,8 @@ class RuntimeDefault extends Runtime { Methods: - + - createInstance(component) + Overrides for R3.Runtime.RuntimeGraphics.createInstance() Static Methods: @@ -3150,33 +3629,26 @@ class RuntimeDefault extends Runtime { **/ -class RuntimeGUI extends Runtime { +class RuntimeThree extends RuntimeGraphics { - constructor(options) { + constructor() { + super(); + } - if (typeof options === 'undefined') { - options = {}; - } + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } + this.emit(Event.CREATE_INSTANCE_BEFORE, this); - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } + this.setRuntime(); - super(options); + this.runtime.createInstance(this); - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } + this.emit(Event.INSTANCE_CREATED, this); } @@ -3184,46 +3656,7 @@ class RuntimeGUI extends Runtime { /** - Class R3.Event.Runtime.Graphics - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.Statistics.Stats [Inherited from Runtime] Inherited Properties: @@ -3242,7 +3675,26 @@ class RuntimeGUI extends Runtime { - [Belonging to RuntimeGraphics] + [Inherited from RuntimeStatistics] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeStats] Properties: @@ -3254,7 +3706,8 @@ class RuntimeGUI extends Runtime { Methods: - + - createInstance(component) + Overrides for R3.Runtime.RuntimeStatistics.createInstance() Static Methods: @@ -3262,369 +3715,26 @@ class RuntimeGUI extends Runtime { **/ -class RuntimeGraphics extends Runtime { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } +class RuntimeStats extends RuntimeStatistics { + constructor() { + super(); } -} + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { -/** + this.emit(Event.CREATE_INSTANCE_BEFORE, this); - Class R3.Event.Runtime.Physics - [Inherited from Event] + this.setRuntime(); - Inherited Properties: + this.runtime.createInstance(this); - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimePhysics] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimePhysics extends Runtime { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.Socket - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeSocket] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeSocket extends Runtime { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.Statistics - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeStatistics] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeStatistics extends Runtime { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } + this.emit(Event.INSTANCE_CREATED, this); } @@ -3998,786 +4108,6 @@ class Project extends R3Object { } -/** - - Class R3.Event.Runtime.Coder.CodeMirror - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeCoder] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeCodeMirror] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeCodeMirror extends RuntimeCoder { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.DOM.Document - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeDOM] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeDocument] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeDocument extends RuntimeDOM { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.GUI.ControlKit - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeGUI] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeControlKit] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeControlKit extends RuntimeGUI { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.Graphics.Three - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeGraphics] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeThree] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeThree extends RuntimeGraphics { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.Physics.Bullet - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimePhysics] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeBullet] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeBullet extends RuntimePhysics { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - -/** - - Class R3.Event.Runtime.Statistics.Stats - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 RuntimeStatistics] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to RuntimeStats] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class RuntimeStats extends RuntimeStatistics { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - /** Class R3.Event.Object.Component.DOM @@ -5420,7 +4750,11 @@ class ComponentInput extends Component { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -5458,6 +4792,30 @@ class ComponentCanvas extends ComponentDOM { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } /** @@ -5589,7 +4947,11 @@ class ComponentCanvas extends ComponentDOM { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -5627,6 +4989,30 @@ class ComponentImage extends ComponentGraphics { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } /** @@ -5758,7 +5144,11 @@ class ComponentImage extends ComponentGraphics { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -5796,6 +5186,30 @@ class ComponentMaterial extends ComponentGraphics { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } /** @@ -5927,7 +5341,11 @@ class ComponentMaterial extends ComponentGraphics { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -5965,6 +5383,30 @@ class ComponentMesh extends ComponentGraphics { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } /** @@ -6096,7 +5538,11 @@ class ComponentMesh extends ComponentGraphics { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -6134,6 +5580,30 @@ class ComponentTexture extends ComponentGraphics { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } /** @@ -6265,7 +5735,11 @@ class ComponentTexture extends ComponentGraphics { Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -6303,13 +5777,37 @@ class ComponentTouch extends ComponentInput { } + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + } R3.Entity = Entity; +R3.Runtime = Runtime; R3.System = System; R3.Event = Event; R3.Utils = Utils; -R3.Runtime = Runtime; R3.Object = R3Object; R3.Component = Component; R3.Project = Project; @@ -6336,6 +5834,7 @@ Component.Graphics.Mesh = ComponentMesh; Component.Graphics.Texture = ComponentTexture; Component.Input = ComponentInput; Component.Input.Touch = ComponentTouch; +Runtime.Bullet = RuntimeBullet; Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; @@ -6346,7 +5845,6 @@ Runtime.GUI.ControlKit = RuntimeControlKit; Runtime.Graphics = RuntimeGraphics; Runtime.Graphics.Three = RuntimeThree; Runtime.Physics = RuntimePhysics; -Runtime.Physics.Bullet = RuntimeBullet; Runtime.Socket = RuntimeSocket; Runtime.Statistics = RuntimeStatistics; Runtime.Statistics.Stats = RuntimeStats; diff --git a/package.json b/package.json index b210237..88a8e07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.522", + "version" : "2.0.533", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index 0e8defb..8932585 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -133,7 +133,11 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentCanvas extends ComponentDOM { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index 7c8c814..87af49d 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -133,7 +133,11 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentImage extends ComponentGraphics { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 867a7a4..890a669 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -133,7 +133,11 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentMaterial extends ComponentGraphics { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index 53dd6e4..59782e6 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -133,7 +133,11 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentMesh extends ComponentGraphics { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index f81159c..9bcc7a2 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -133,7 +133,11 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentTexture extends ComponentGraphics { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index 832125d..25d0bb4 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -133,7 +133,11 @@ const ComponentInput = require('.././r3-component-input.js'); Methods: - + - updateInstance() + No comment + + - updateFromInstance() + No comment Static Methods: @@ -154,6 +158,8 @@ const ComponentInput = require('.././r3-component-input.js'); CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_METHODS_START + updateInstance() + updateFromInstance() CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START @@ -205,6 +211,47 @@ class ComponentTouch extends ComponentInput { //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * updateInstance() + * - No comment + */ + updateInstance() { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - No comment + */ + updateFromInstance() { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //GENERATED_STATIC_METHODS_START diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index f42f526..f81d486 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -366,16 +366,19 @@ Event.MOUSE_WHEEL = 0x14; Event.OBJECT_CREATED = 0x15; Event.OBJECT_INITIALIZED = 0x16; Event.PAUSE = 0x17; -Event.PROJECT_INITIALIZED = 0x18; -Event.RESTART = 0x19; -Event.START = 0x1a; -Event.TOUCH_CANCEL = 0x1b; -Event.TOUCH_END = 0x1c; -Event.TOUCH_MOVE = 0x1d; -Event.TOUCH_START = 0x1e; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x1f; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x20; -Event.MAX_EVENTS = 0x21; +Event.PROJECT_CREATED = 0x18; +Event.PROJECT_INITIALIZED = 0x19; +Event.RESTART = 0x1a; +Event.START = 0x1b; +Event.TOUCH_CANCEL = 0x1c; +Event.TOUCH_END = 0x1d; +Event.TOUCH_MOVE = 0x1e; +Event.TOUCH_START = 0x1f; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x20; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x21; +Event.UPDATE_INSTANCE_AFTER = 0x22; +Event.UPDATE_INSTANCE_BEFORE = 0x23; +Event.MAX_EVENTS = 0x24; Event.GetEventName = function(eventId) { @@ -403,15 +406,18 @@ Event.GetEventName = function(eventId) { case 0x15 : return 'object_created'; case 0x16 : return 'object_initialized'; case 0x17 : return 'pause'; - case 0x18 : return 'project_initialized'; - case 0x19 : return 'restart'; - case 0x1a : return 'start'; - case 0x1b : return 'touch_cancel'; - case 0x1c : return 'touch_end'; - case 0x1d : return 'touch_move'; - case 0x1e : return 'touch_start'; - case 0x1f : return 'update_from_instance_after'; - case 0x20 : return 'update_from_instance_before'; + case 0x18 : return 'project_created'; + case 0x19 : return 'project_initialized'; + case 0x1a : return 'restart'; + case 0x1b : return 'start'; + case 0x1c : return 'touch_cancel'; + case 0x1d : return 'touch_end'; + case 0x1e : return 'touch_move'; + case 0x1f : return 'touch_start'; + case 0x20 : return 'update_from_instance_after'; + case 0x21 : return 'update_from_instance_before'; + case 0x22 : return 'update_instance_after'; + case 0x23 : return 'update_instance_before'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 8d60b96..c51ba37 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,14 +1,14 @@ class R3 { - static version = '2.0.522'; - static compileDate = '2021 Sep 10 - 11:12:39 am'; + static version = '2.0.533'; + static compileDate = '2021 Sep 10 - 14:01:56 pm'; } //GENERATED_IMPORTS_START const Entity = require('./r3-entity/'); +const Runtime = require('./r3-runtime/'); const System = require('./r3-system/'); const Event = require('./r3-event.js'); const Utils = require('./r3-utils.js'); -const Runtime = require('./r3-runtime/'); const R3Object = require('./r3-r3-object.js'); const Component = require('./r3-component/'); const Project = require('./r3-project.js'); @@ -16,10 +16,10 @@ const Project = require('./r3-project.js'); //GENERATED_DEFINES_START R3.Entity = Entity; +R3.Runtime = Runtime; R3.System = System; R3.Event = Event; R3.Utils = Utils; -R3.Runtime = Runtime; R3.Object = R3Object; R3.Component = Component; R3.Project = Project; diff --git a/src/r3/r3-runtime/index.js b/src/r3/r3-runtime/index.js index f37a9df..46b6cda 100644 --- a/src/r3/r3-runtime/index.js +++ b/src/r3/r3-runtime/index.js @@ -1,5 +1,6 @@ //GENERATED_IMPORTS_START const Runtime = require('./r3-runtime.js'); +const RuntimeBullet = require('./r3-runtime-bullet.js'); const RuntimeCoder = require('./r3-runtime-coder.js'); const RuntimeCodeMirror = require('./r3-runtime-code-mirror.js'); const RuntimeDOM = require('./r3-runtime-d-o-m.js'); @@ -10,13 +11,13 @@ const RuntimeControlKit = require('./r3-runtime-control-kit.js'); const RuntimeGraphics = require('./r3-runtime-graphics.js'); const RuntimeThree = require('./r3-runtime-three.js'); const RuntimePhysics = require('./r3-runtime-physics.js'); -const RuntimeBullet = require('./r3-runtime-bullet.js'); const RuntimeSocket = require('./r3-runtime-socket.js'); const RuntimeStatistics = require('./r3-runtime-statistics.js'); const RuntimeStats = require('./r3-runtime-stats.js'); //GENERATED_IMPORTS_END //GENERATED_INDEX_BODY_START +Runtime.Bullet = RuntimeBullet; Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; @@ -27,7 +28,6 @@ Runtime.GUI.ControlKit = RuntimeControlKit; Runtime.Graphics = RuntimeGraphics; Runtime.Graphics.Three = RuntimeThree; Runtime.Physics = RuntimePhysics; -Runtime.Physics.Bullet = RuntimeBullet; Runtime.Socket = RuntimeSocket; Runtime.Statistics = RuntimeStatistics; Runtime.Statistics.Stats = RuntimeStats; diff --git a/src/r3/r3-runtime/r3-runtime-bullet.js b/src/r3/r3-runtime/r3-runtime-bullet.js index df96b24..f0fc703 100644 --- a/src/r3/r3-runtime/r3-runtime-bullet.js +++ b/src/r3/r3-runtime/r3-runtime-bullet.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Bullet + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeBullet] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeBullet extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-code-mirror.js b/src/r3/r3-runtime/r3-runtime-code-mirror.js index 304c9a9..6845433 100644 --- a/src/r3/r3-runtime/r3-runtime-code-mirror.js +++ b/src/r3/r3-runtime/r3-runtime-code-mirror.js @@ -6,6 +6,63 @@ const RuntimeCoder = require('./r3-runtime-coder.js'); GENERATED_INHERITED_START + Class R3.Runtime.Coder.CodeMirror + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from RuntimeCoder] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeCodeMirror] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Overrides for R3.Runtime.RuntimeCoder.createInstance() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +74,34 @@ const RuntimeCoder = require('./r3-runtime-coder.js'); class RuntimeCodeMirror extends RuntimeCoder { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-coder.js b/src/r3/r3-runtime/r3-runtime-coder.js index 57c5862..f20010a 100644 --- a/src/r3/r3-runtime/r3-runtime-coder.js +++ b/src/r3/r3-runtime/r3-runtime-coder.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Coder + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeCoder] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeCoder extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-control-kit.js b/src/r3/r3-runtime/r3-runtime-control-kit.js index 59f1eb0..1101541 100644 --- a/src/r3/r3-runtime/r3-runtime-control-kit.js +++ b/src/r3/r3-runtime/r3-runtime-control-kit.js @@ -6,6 +6,63 @@ const RuntimeGUI = require('./r3-runtime-g-u-i.js'); GENERATED_INHERITED_START + Class R3.Runtime.GUI.ControlKit + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from RuntimeGUI] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeControlKit] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Overrides for R3.Runtime.RuntimeGUI.createInstance() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +74,34 @@ const RuntimeGUI = require('./r3-runtime-g-u-i.js'); class RuntimeControlKit extends RuntimeGUI { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-d-o-m.js b/src/r3/r3-runtime/r3-runtime-d-o-m.js index 25f4d4e..0e46320 100644 --- a/src/r3/r3-runtime/r3-runtime-d-o-m.js +++ b/src/r3/r3-runtime/r3-runtime-d-o-m.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.DOM + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeDOM] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeDOM extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-default.js b/src/r3/r3-runtime/r3-runtime-default.js index cbc3490..324d848 100644 --- a/src/r3/r3-runtime/r3-runtime-default.js +++ b/src/r3/r3-runtime/r3-runtime-default.js @@ -6,46 +6,7 @@ const Runtime = require('.././r3-runtime.js'); GENERATED_INHERITED_START - Class R3.Event.Runtime.Default - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - 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 - + Class R3.Runtime.Default [Inherited from Runtime] Inherited Properties: diff --git a/src/r3/r3-runtime/r3-runtime-document.js b/src/r3/r3-runtime/r3-runtime-document.js index edcf2dd..2d2dd68 100644 --- a/src/r3/r3-runtime/r3-runtime-document.js +++ b/src/r3/r3-runtime/r3-runtime-document.js @@ -6,6 +6,63 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js'); GENERATED_INHERITED_START + Class R3.Runtime.DOM.Document + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from RuntimeDOM] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeDocument] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Overrides for R3.Runtime.RuntimeDOM.createInstance() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +74,34 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js'); class RuntimeDocument extends RuntimeDOM { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-g-u-i.js b/src/r3/r3-runtime/r3-runtime-g-u-i.js index dcbb098..98d99ad 100644 --- a/src/r3/r3-runtime/r3-runtime-g-u-i.js +++ b/src/r3/r3-runtime/r3-runtime-g-u-i.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.GUI + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeGUI] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeGUI extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-graphics.js b/src/r3/r3-runtime/r3-runtime-graphics.js index ab3e85e..c36dd98 100644 --- a/src/r3/r3-runtime/r3-runtime-graphics.js +++ b/src/r3/r3-runtime/r3-runtime-graphics.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Graphics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeGraphics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeGraphics extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-physics.js b/src/r3/r3-runtime/r3-runtime-physics.js index bd834ef..3adc753 100644 --- a/src/r3/r3-runtime/r3-runtime-physics.js +++ b/src/r3/r3-runtime/r3-runtime-physics.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Physics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimePhysics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimePhysics extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-socket.js b/src/r3/r3-runtime/r3-runtime-socket.js index b85c519..7a67771 100644 --- a/src/r3/r3-runtime/r3-runtime-socket.js +++ b/src/r3/r3-runtime/r3-runtime-socket.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Socket + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeSocket] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeSocket extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-statistics.js b/src/r3/r3-runtime/r3-runtime-statistics.js index 3dcea1c..5a8775f 100644 --- a/src/r3/r3-runtime/r3-runtime-statistics.js +++ b/src/r3/r3-runtime/r3-runtime-statistics.js @@ -6,6 +6,44 @@ const Runtime = require('./r3-runtime.js'); GENERATED_INHERITED_START + Class R3.Runtime.Statistics + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to RuntimeStatistics] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +55,34 @@ const Runtime = require('./r3-runtime.js'); class RuntimeStatistics extends Runtime { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-stats.js b/src/r3/r3-runtime/r3-runtime-stats.js index 1c8efda..28444ee 100644 --- a/src/r3/r3-runtime/r3-runtime-stats.js +++ b/src/r3/r3-runtime/r3-runtime-stats.js @@ -6,6 +6,63 @@ const RuntimeStatistics = require('./r3-runtime-statistics.js'); GENERATED_INHERITED_START + Class R3.Runtime.Statistics.Stats + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from RuntimeStatistics] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeStats] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Overrides for R3.Runtime.RuntimeStatistics.createInstance() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +74,34 @@ const RuntimeStatistics = require('./r3-runtime-statistics.js'); class RuntimeStats extends RuntimeStatistics { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime-three.js b/src/r3/r3-runtime/r3-runtime-three.js index 075ede2..13513f8 100644 --- a/src/r3/r3-runtime/r3-runtime-three.js +++ b/src/r3/r3-runtime/r3-runtime-three.js @@ -6,6 +6,63 @@ const RuntimeGraphics = require('./r3-runtime-graphics.js'); GENERATED_INHERITED_START + Class R3.Runtime.Graphics.Three + [Inherited from Runtime] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from RuntimeGraphics] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance(component) + Creates an instance of R3.Component based on this Runtime. + + Inherited Static Methods: + + + + [Belonging to RuntimeThree] + + Properties: + + + + Static Properties: + + + + Methods: + + - createInstance(component) + Overrides for R3.Runtime.RuntimeGraphics.createInstance() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_METHODS_START @@ -17,9 +74,34 @@ const RuntimeGraphics = require('./r3-runtime-graphics.js'); class RuntimeThree extends RuntimeGraphics { //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor() { + super(); + } //GENERATED_CONSTRUCTOR_EXTENDS_END //GENERATED_METHODS_START + + /** + * createInstance() + * - Creates an instance of R3.Component based on this Runtime. + * @param component + */ + createInstance(component) { + + //GENERATED_CREATE_INSTANCE_METHOD_START + this.emit(Event.CREATE_INSTANCE_BEFORE, this); + + this.setRuntime(); + + this.runtime.createInstance(this); + + this.emit(Event.INSTANCE_CREATED, this); + //GENERATED_CREATE_INSTANCE_METHOD_END + + //CUSTOM_CREATE_INSTANCE_METHOD_START + //CUSTOM_CREATE_INSTANCE_METHOD_END + + } //GENERATED_METHODS_END //CUSTOM_IMPLEMENTATION_START diff --git a/src/r3/r3-runtime/r3-runtime.js b/src/r3/r3-runtime/r3-runtime.js index 032aaee..cf40d53 100644 --- a/src/r3/r3-runtime/r3-runtime.js +++ b/src/r3/r3-runtime/r3-runtime.js @@ -14,6 +14,9 @@ const Utils = require('.././r3-utils'); class Runtime { //GENERATED_CONSTRUCTOR_START + constructor() { + + } //GENERATED_CONSTRUCTOR_END //GENERATED_METHODS_START @@ -25,6 +28,21 @@ class Runtime { } //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START +Runtime.RUNTIME_BULLET = 0x0; +Runtime.RUNTIME_CODER = 0x1; +Runtime.RUNTIME_CODE_MIRROR = 0x2; +Runtime.RUNTIME_DOM = 0x3; +Runtime.RUNTIME_DOCUMENT = 0x4; +Runtime.RUNTIME_DEFAULT = 0x5; +Runtime.RUNTIME_GUI = 0x6; +Runtime.RUNTIME_CONTROL_KIT = 0x7; +Runtime.RUNTIME_GRAPHICS = 0x8; +Runtime.RUNTIME_THREE = 0x9; +Runtime.RUNTIME_PHYSICS = 0xa; +Runtime.RUNTIME_SOCKET = 0xb; +Runtime.RUNTIME_STATISTICS = 0xc; +Runtime.RUNTIME_STATS = 0xd; +Runtime.MAX_RUNTIME = 0xe; //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 d603c08..a263fcf 100644 --- a/src/r3/r3-system/r3-system-d-o-m.js +++ b/src/r3/r3-system/r3-system-d-o-m.js @@ -1,6 +1,6 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); -const System = require('./r3-system.js'); +const System = require('.././r3-system.js'); /** @@ -183,8 +183,6 @@ class SystemDOM extends System { //GENERATED_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END //CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_START - console.log('DOM Component Initialized'); - object.createInstance(); //CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END @@ -193,7 +191,6 @@ class SystemDOM extends System { //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } //GENERATED_STATIC_OPTIONS_INIT_START diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index cc83be6..63d6f13 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -1,6 +1,6 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); -const System = require('./r3-system.js'); +const System = require('.././r3-system.js'); /** @@ -415,7 +415,6 @@ class SystemInput extends System { //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } //GENERATED_STATIC_OPTIONS_INIT_START diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index 6db01ea..fa788b2 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -1,6 +1,6 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); -const System = require('./r3-system.js'); +const System = require('.././r3-system.js'); /** @@ -244,7 +244,6 @@ class SystemLinking extends System { //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } //GENERATED_STATIC_OPTIONS_INIT_START diff --git a/src/r3/r3-system/r3-system-runtime.js b/src/r3/r3-system/r3-system-runtime.js index 94db23e..c947192 100644 --- a/src/r3/r3-system/r3-system-runtime.js +++ b/src/r3/r3-system/r3-system-runtime.js @@ -1,6 +1,6 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); -const System = require('./r3-system.js'); +const System = require('.././r3-system.js'); /** @@ -35,6 +35,14 @@ const System = require('./r3-system.js'); - Started (Default value false) - Subscriptions (Default value {}) + - 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: @@ -56,6 +64,14 @@ const System = require('./r3-system.js'); CUSTOM_STATIC_OPTIONS_START Started=false Subscriptions={} + Projects=[] + CurrentProject=null + RuntimeCoder={} + RuntimeDOM={} + RuntimeGUI={} + RuntimeGraphics={} + RuntimePhysics={} + RuntimeStatistics={} CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -63,6 +79,7 @@ const System = require('./r3-system.js'); CUSTOM_STATIC_EVENT_LISTENERS_START Event.GET_RUNTIME + Event.PROJECT_CREATED CUSTOM_STATIC_EVENT_LISTENERS_END CUSTOM_METHODS_START @@ -122,6 +139,11 @@ class SystemRuntime extends System { SystemRuntime.OnGetRuntime ); + SystemRuntime.Subscriptions['PROJECT_CREATED'] = Event.Subscribe( + Event.PROJECT_CREATED, + SystemRuntime.OnProjectCreated + ); + //GENERATED_STATIC_EVENT_LISTENERS_START_END //CUSTOM_BEFORE_STATIC_SYSTEM_START_START @@ -151,6 +173,9 @@ class SystemRuntime extends System { SystemRuntime.Subscriptions['GET_RUNTIME'].remove(); delete SystemRuntime.Subscriptions['GET_RUNTIME']; + SystemRuntime.Subscriptions['PROJECT_CREATED'].remove(); + delete SystemRuntime.Subscriptions['PROJECT_CREATED']; + //GENERATED_STATIC_EVENT_LISTENERS_STOP_END //CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START @@ -186,21 +211,50 @@ class SystemRuntime extends System { //CUSTOM_STATIC_ON_GET_RUNTIME_METHOD_START if (object instanceof R3.Component.DOM) { - + if (SystemRuntime.CurrentProject === null) { + console.log('There currently is no active project - using the default DOM runtime'); + } else { + console.log('TODO: implement a project based DOM runtime'); + } } //CUSTOM_STATIC_ON_GET_RUNTIME_METHOD_END + } + + /** + * OnProjectCreated() + * - Listens to events of type Event.PROJECT_CREATED and executes this function. + * @param object (The event data passed as argument - typically an R3Object) + * @return null + */ + static OnProjectCreated(object) { + + //GENERATED_STATIC_ON_PROJECT_CREATED_METHOD_START + //GENERATED_STATIC_ON_PROJECT_CREATED_METHOD_END + + //CUSTOM_STATIC_ON_PROJECT_CREATED_METHOD_START + Utils.PushUnique(SystemRuntime.Projects, object); + SystemRuntime.CurrentProject = object; + //CUSTOM_STATIC_ON_PROJECT_CREATED_METHOD_END + } //GENERATED_STATIC_EVENT_LISTENER_METHODS_END //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } //GENERATED_STATIC_OPTIONS_INIT_START SystemRuntime.Started = false; SystemRuntime.Subscriptions = {}; +SystemRuntime.Projects = []; +SystemRuntime.CurrentProject = null; +SystemRuntime.RuntimeCoder = {}; +SystemRuntime.RuntimeDOM = {}; +SystemRuntime.RuntimeGUI = {}; +SystemRuntime.RuntimeGraphics = {}; +SystemRuntime.RuntimePhysics = {}; +SystemRuntime.RuntimeStatistics = {}; //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 4a84dfa..0f06b58 100644 --- a/src/r3/r3-system/r3-system-socket.js +++ b/src/r3/r3-system/r3-system-socket.js @@ -1,6 +1,6 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); -const System = require('./r3-system.js'); +const System = require('.././r3-system.js'); /** @@ -168,7 +168,6 @@ class SystemSocket extends System { //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } //GENERATED_STATIC_OPTIONS_INIT_START diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index 47a7ebd..3181645 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -26,6 +26,26 @@ const Utils = require('.././r3-utils'); class System { //GENERATED_CONSTRUCTOR_START + constructor(options) { + + if (typeof options === 'undefined') { + 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 + + //CUSTOM_AFTER_INIT_START + //CUSTOM_AFTER_INIT_END + } //GENERATED_CONSTRUCTOR_END //GENERATED_METHODS_START @@ -49,6 +69,12 @@ class System { //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START +System.SYSTEM_DOM = 0x0; +System.SYSTEM_INPUT = 0x1; +System.SYSTEM_LINKING = 0x2; +System.SYSTEM_RUNTIME = 0x3; +System.SYSTEM_SOCKET = 0x4; +System.MAX_SYSTEM = 0x5; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/templates/system_extends.template b/src/templates/system_extends.template index ebde25a..be79adc 100644 --- a/src/templates/system_extends.template +++ b/src/templates/system_extends.template @@ -43,10 +43,19 @@ class CLASS_NAME extends EXTEND_CLASS { //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END + //GENERATED_EVENT_LISTENER_METHODS_START + //GENERATED_EVENT_LISTENER_METHODS_END + + //GENERATED_STATIC_EVENT_LISTENER_METHODS_START + //GENERATED_STATIC_EVENT_LISTENER_METHODS_END + //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END } +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/templates/token.db b/src/templates/token.db index fde7a9a..29a9f5b 100644 --- a/src/templates/token.db +++ b/src/templates/token.db @@ -38,6 +38,7 @@ GENERATED_STATIC_ON_MOUSE_UP_METHOD GENERATED_STATIC_ON_MOUSE_WHEEL_METHOD GENERATED_STATIC_ON_OBJECT_CREATED_METHOD GENERATED_STATIC_ON_OBJECT_INITIALIZED_METHOD +GENERATED_STATIC_ON_PROJECT_CREATED_METHOD GENERATED_STATIC_ON_TOUCH_CANCEL_METHOD GENERATED_STATIC_ON_TOUCH_END_METHOD GENERATED_STATIC_ON_TOUCH_MOVE_METHOD @@ -49,6 +50,7 @@ GENERATED_STATIC_SUBSCRIBE_METHOD GENERATED_SUBSCRIBE_METHOD GENERATED_UPDATE_FROM_INSTANCE_METHOD GENERATED_UPDATE_FROM_INSTANCE_OPTIONS +GENERATED_UPDATE_INSTANCE_METHOD GENERATED_UPDATE_INSTANCE_OPTIONS CUSTOM_AFTER_INIT CUSTOM_ASYNC_METHOD @@ -90,6 +92,7 @@ CUSTOM_STATIC_ON_MOUSE_UP_METHOD CUSTOM_STATIC_ON_MOUSE_WHEEL_METHOD CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD CUSTOM_STATIC_ON_OBJECT_INITIALIZED_METHOD +CUSTOM_STATIC_ON_PROJECT_CREATED_METHOD CUSTOM_STATIC_ON_TOUCH_CANCEL_METHOD CUSTOM_STATIC_ON_TOUCH_END_METHOD CUSTOM_STATIC_ON_TOUCH_MOVE_METHOD @@ -100,3 +103,4 @@ CUSTOM_STATIC_STOP_METHOD CUSTOM_STATIC_SUBSCRIBE_METHOD CUSTOM_SUBSCRIBE_METHOD CUSTOM_UPDATE_FROM_INSTANCE_METHOD +CUSTOM_UPDATE_INSTANCE_METHOD diff --git a/version b/version index 337ef6d..9863431 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.522 \ No newline at end of file +2.0.533 \ No newline at end of file