fix callDepth

master
Theunis J. Botha 2021-09-08 05:08:48 +02:00
parent 914e03c8e4
commit 7c12d4efdd
36 changed files with 64 additions and 447 deletions

View File

@ -6,7 +6,6 @@ r3 create Project extends R3Object
r3 create System system-base
r3 create SystemSocket system
r3 create SystemLinking system
r3 create SystemTest system
r3 create Component extends R3Object ./r3-component/
r3 create Image extends Component ./r3-component/
r3 create SystemInput system

189
dist/r3.js vendored
View File

@ -1,6 +1,6 @@
class R3 {
static version = '2.0.199';
static compileDate = '2021 Sep 08 - 04:57:21 am';
static version = '2.0.202';
static compileDate = '2021 Sep 08 - 05:07:45 am';
}
/**
@ -29,6 +29,7 @@ class System {
if (typeof options.started === 'undefined') {
options.started = false;
}
if (typeof options.subscriptions === 'undefined') {
options.subscriptions = {};
}
@ -37,8 +38,8 @@ class System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -69,8 +70,8 @@ class Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -371,8 +372,8 @@ class Utils {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -1681,8 +1682,8 @@ class SystemInput extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -1991,8 +1992,8 @@ class SystemLinking extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2159,8 +2160,8 @@ class SystemSocket extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2224,138 +2225,6 @@ class SystemSocket extends System {
}
/**
Class R3.System.Test
[Inherited from System]
Inherited Properties:
- started (Default value false)
- subscriptions (Default value {})
Inherited Static Properties:
- Started (Default value false)
- Subscriptions (Default value {})
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemTest]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
- start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Static Methods:
- Start(options)
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
**/
class SystemTest extends System {
constructor(options) {
if (typeof options === 'undefined') {
options = {};
}
if (typeof options.callDepth === 'undefined') {
options.callDepth = 0;
} else {
options.callDepth++;
}
super(options);
Object.assign(this, options);
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
options.callDepth--;
}
}
/**
* start()
* - Just calls System.Start(options)
* @param options
*/
start(options) {
this.started = true;
console.log('Started transient system: SystemTest');
}
/**
* stop()
* - Just calls System.Stop(options)
* @param options
*/
stop(options) {
this.started = false;
console.log('Stopped transient system: SystemTest');
}
/**
* Start()
* - Starts the system by registering subscriptions to events
* @param options
*/
static Start(options) {
SystemTest.Started = true;
console.log('Started system: SystemTest');
}
/**
* Stop()
* - Stops the system by removing these subscriptions to events
* @param options
*/
static Stop(options) {
SystemTest.Started = false;
console.log('Stopped system: SystemTest');
}
}
/**
Class R3.Event.Runtime
@ -2435,8 +2304,8 @@ class Runtime extends Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2527,8 +2396,8 @@ class R3Object extends Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2633,8 +2502,8 @@ class Coder extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2739,8 +2608,8 @@ class Default extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2845,8 +2714,8 @@ class GUI extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -2951,8 +2820,8 @@ class Graphics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3057,8 +2926,8 @@ class Physics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3163,8 +3032,8 @@ class Socket extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3269,8 +3138,8 @@ class Statistics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3388,8 +3257,8 @@ class Component extends R3Object {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3570,8 +3439,8 @@ class Project extends R3Object {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3694,8 +3563,8 @@ class CodeMirror extends Coder {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3818,8 +3687,8 @@ class ControlKit extends GUI {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -3942,8 +3811,8 @@ class Three extends Graphics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4066,8 +3935,8 @@ class Bullet extends Physics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4190,8 +4059,8 @@ class Stats extends Statistics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4327,8 +4196,8 @@ class Image extends Component {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4464,8 +4333,8 @@ class Input extends Component {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4620,8 +4489,8 @@ class Touch extends Input {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}
@ -4633,7 +4502,6 @@ R3.System = System;
R3.System.Input = SystemInput;
R3.System.Linking = SystemLinking;
R3.System.Socket = SystemSocket;
R3.System.Test = SystemTest;
R3.Event = Event;
R3.Event.Runtime = Runtime;
R3.Event.Coder = Coder;
@ -4696,5 +4564,4 @@ console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);
R3.System.Input.Start();
R3.System.Linking.Start();
R3.System.Socket.Start();
R3.System.Test.Start();

View File

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

View File

@ -10,7 +10,6 @@ console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);
R3.System.Input.Start();
R3.System.Linking.Start();
R3.System.Socket.Start();
R3.System.Test.Start();
//GENERATED_INDEX_BODY_END
module.exports = {

View File

@ -149,8 +149,8 @@ class Component extends R3Object {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -162,8 +162,8 @@ class Image extends Component {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -162,8 +162,8 @@ class Input extends Component {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -180,8 +180,8 @@ class Touch extends Input {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -53,8 +53,8 @@ class Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Project extends R3Object {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -101,6 +101,7 @@ class R3Object extends Event {
super(options);
//GENERATED_OPTIONS_INIT_START
if (typeof options.register === 'undefined') {
options.register = true;
}
@ -116,8 +117,8 @@ class R3Object extends Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -1,6 +1,6 @@
class R3 {
static version = '2.0.199';
static compileDate = '2021 Sep 08 - 04:57:21 am';
static version = '2.0.202';
static compileDate = '2021 Sep 08 - 05:07:45 am';
}
//GENERATED_IMPORTS_START
@ -10,7 +10,6 @@ const Utils = require('./r3-utils.js');
const SystemInput = require('./r3-system/r3-system-input.js');
const SystemLinking = require('./r3-system/r3-system-linking.js');
const SystemSocket = require('./r3-system/r3-system-socket.js');
const SystemTest = require('./r3-system/r3-system-test.js');
const Runtime = require('./r3-runtime/r3-runtime.js');
const R3Object = require('./r3-r3-object.js');
const Coder = require('./r3-runtime/r3-coder.js');
@ -37,7 +36,6 @@ R3.System = System;
R3.System.Input = SystemInput;
R3.System.Linking = SystemLinking;
R3.System.Socket = SystemSocket;
R3.System.Test = SystemTest;
R3.Event = Event;
R3.Event.Runtime = Runtime;
R3.Event.Coder = Coder;

View File

@ -149,8 +149,8 @@ class Bullet extends Physics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -149,8 +149,8 @@ class CodeMirror extends Coder {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Coder extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -149,8 +149,8 @@ class ControlKit extends GUI {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Default extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class GUI extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Graphics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Physics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -112,8 +112,8 @@ class Runtime extends Event {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Socket extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -131,8 +131,8 @@ class Statistics extends Runtime {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -149,8 +149,8 @@ class Stats extends Statistics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -149,8 +149,8 @@ class Three extends Graphics {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -3,7 +3,6 @@ const System = require('./r3-system.js');
const SystemInput = require('./r3-system-input.js');
const SystemLinking = require('./r3-system-linking.js');
const SystemSocket = require('./r3-system-socket.js');
const SystemTest = require('./r3-system-test.js');
//GENERATED_IMPORTS_END
//GENERATED_INDEX_BODY_START
@ -14,7 +13,6 @@ module.exports = {
System,
SystemInput,
SystemLinking,
SystemSocket,
SystemTest
SystemSocket
//GENERATED_EXPORTS_END
}

View File

@ -119,8 +119,8 @@ class SystemInput extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -111,8 +111,8 @@ class SystemLinking extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -109,8 +109,8 @@ class SystemSocket extends System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -1,248 +0,0 @@
const Event = require('.././r3-event');
const Utils = require('.././r3-utils');
const System = require('./r3-system.js');
/**
GENERATED_INHERITED_START
Class R3.System.Test
[Inherited from System]
Inherited Properties:
- started (Default value false)
- subscriptions (Default value {})
Inherited Static Properties:
- Started (Default value false)
- Subscriptions (Default value {})
Inherited Methods:
<no inherited methods>
Inherited Static Methods:
<no inherited static methods>
[Belonging to SystemTest]
Properties:
<no properties>
Static Properties:
<no static properties>
Methods:
- start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Static Methods:
- Start(options)
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
GENERATED_INHERITED_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_STATIC_OPTIONS_START
CUSTOM_STATIC_OPTIONS_END
CUSTOM_EVENT_LISTENERS_START
CUSTOM_EVENT_LISTENERS_END
CUSTOM_STATIC_EVENT_LISTENERS_START
CUSTOM_STATIC_EVENT_LISTENERS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
class SystemTest extends System {
//GENERATED_CONSTRUCTOR_EXTENDS_START
constructor(options) {
if (typeof options === 'undefined') {
options = {};
}
if (typeof options.callDepth === 'undefined') {
options.callDepth = 0;
} else {
options.callDepth++;
}
super(options);
//GENERATED_OPTIONS_INIT_START
//GENERATED_OPTIONS_INIT_END
//CUSTOM_OPTIONS_INIT_START
//CUSTOM_OPTIONS_INIT_END
Object.assign(this, options);
//CUSTOM_BEFORE_INIT_START
//CUSTOM_BEFORE_INIT_END
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
options.callDepth--;
}
//CUSTOM_AFTER_INIT_START
//CUSTOM_AFTER_INIT_END
}
//GENERATED_CONSTRUCTOR_EXTENDS_END
//GENERATED_METHODS_START
/**
* start()
* - Just calls System.Start(options)
* @param options
*/
start(options) {
//GENERATED_START_METHOD_START
//GENERATED_EVENT_LISTENERS_START_START
//GENERATED_EVENT_LISTENERS_START_END
//CUSTOM_BEFORE_SYSTEM_START_START
//CUSTOM_BEFORE_SYSTEM_START_END
this.started = true;
console.log('Started transient system: SystemTest');
//GENERATED_START_METHOD_END
//CUSTOM_START_METHOD_START
//CUSTOM_START_METHOD_END
}
/**
* stop()
* - Just calls System.Stop(options)
* @param options
*/
stop(options) {
//GENERATED_STOP_METHOD_START
//GENERATED_EVENT_LISTENERS_STOP_START
//GENERATED_EVENT_LISTENERS_STOP_END
//CUSTOM_BEFORE_SYSTEM_STOP_START
//CUSTOM_BEFORE_SYSTEM_STOP_END
this.started = false;
console.log('Stopped transient system: SystemTest');
//GENERATED_STOP_METHOD_END
//CUSTOM_STOP_METHOD_START
//CUSTOM_STOP_METHOD_END
}
//GENERATED_METHODS_END
//GENERATED_STATIC_METHODS_START
/**
* Start()
* - Starts the system by registering subscriptions to events
* @param options
*/
static Start(options) {
//GENERATED_STATIC_START_METHOD_START
//GENERATED_STATIC_EVENT_LISTENERS_START_START
//GENERATED_STATIC_EVENT_LISTENERS_START_END
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
//CUSTOM_BEFORE_STATIC_SYSTEM_START_END
SystemTest.Started = true;
console.log('Started system: SystemTest');
//GENERATED_STATIC_START_METHOD_END
//CUSTOM_STATIC_START_METHOD_START
//CUSTOM_STATIC_START_METHOD_END
}
/**
* Stop()
* - Stops the system by removing these subscriptions to events
* @param options
*/
static Stop(options) {
//GENERATED_STATIC_STOP_METHOD_START
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_END
SystemTest.Started = false;
console.log('Stopped system: SystemTest');
//GENERATED_STATIC_STOP_METHOD_END
//CUSTOM_STATIC_STOP_METHOD_START
//CUSTOM_STATIC_STOP_METHOD_END
}
//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
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = SystemTest;

View File

@ -45,9 +45,11 @@ class System {
}
//GENERATED_OPTIONS_INIT_START
if (typeof options.started === 'undefined') {
options.started = false;
}
if (typeof options.subscriptions === 'undefined') {
options.subscriptions = {};
}
@ -63,8 +65,8 @@ class System {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -47,8 +47,8 @@ class Utils {
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -25,8 +25,8 @@
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -25,8 +25,8 @@
if (options.callDepth === 0) {
Event.Emit(Event.OBJECT_INITIALIZED);
} else {
delete this.callDepth;
} else {
options.callDepth--;
}

View File

@ -1,3 +1,4 @@
if (typeof options.KEY === 'undefined') {
options.KEY = VALUE;
}

View File

@ -1 +1 @@
2.0.199
2.0.202