input system
parent
b745fa0690
commit
8d3554b46b
|
@ -1,12 +1,12 @@
|
||||||
class R3 {
|
class R3 {
|
||||||
static version = '2.0.163';
|
static version = '2.0.176';
|
||||||
static compileDate = '2021 Sep 06 - 12:30:38 pm';
|
static compileDate = '2021 Sep 06 - 13:04:25 pm';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Started=false
|
Started=false
|
||||||
Subscriptions=[]
|
Subscriptions={}
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class System {
|
||||||
options.started = false;
|
options.started = false;
|
||||||
}
|
}
|
||||||
if (typeof options.subscriptions === 'undefined') {
|
if (typeof options.subscriptions === 'undefined') {
|
||||||
options.subscriptions = [];
|
options.subscriptions = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(this, options);
|
Object.assign(this, options);
|
||||||
|
@ -36,7 +36,7 @@ class System {
|
||||||
}
|
}
|
||||||
|
|
||||||
System.Started = false;
|
System.Started = false;
|
||||||
System.Subscriptions = [];
|
System.Subscriptions = {};
|
||||||
|
|
||||||
class Event {
|
class Event {
|
||||||
|
|
||||||
|
@ -226,6 +226,7 @@ class Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
Event.Subscriptions[eventId][subscriptionId] = callback;
|
Event.Subscriptions[eventId][subscriptionId] = callback;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Event.Subscriptions[eventId] = {};
|
Event.Subscriptions[eventId] = {};
|
||||||
Event.Subscriptions[eventId][subscriptionId] = callback;
|
Event.Subscriptions[eventId][subscriptionId] = callback;
|
||||||
|
@ -253,6 +254,8 @@ class Event {
|
||||||
if (listeners.length === 0) {
|
if (listeners.length === 0) {
|
||||||
delete Event.Subscriptions[eventId];
|
delete Event.Subscriptions[eventId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}(eventId, subscriptionId),
|
}(eventId, subscriptionId),
|
||||||
|
@ -282,12 +285,11 @@ Event.OBJECT_INITIALIZED = 0x10;
|
||||||
Event.PAUSE = 0x11;
|
Event.PAUSE = 0x11;
|
||||||
Event.RESTART = 0x12;
|
Event.RESTART = 0x12;
|
||||||
Event.START = 0x13;
|
Event.START = 0x13;
|
||||||
Event.TEST_EVENT = 0x14;
|
Event.TOUCH_CANCEL = 0x14;
|
||||||
Event.TOUCH_CANCEL = 0x15;
|
Event.TOUCH_END = 0x15;
|
||||||
Event.TOUCH_END = 0x16;
|
Event.TOUCH_MOVE = 0x16;
|
||||||
Event.TOUCH_MOVE = 0x17;
|
Event.TOUCH_START = 0x17;
|
||||||
Event.TOUCH_START = 0x18;
|
Event.MAX_EVENTS = 0x18;
|
||||||
Event.MAX_EVENTS = 0x19;
|
|
||||||
|
|
||||||
Event.GetEventName = function(eventId) {
|
Event.GetEventName = function(eventId) {
|
||||||
|
|
||||||
|
@ -311,11 +313,10 @@ Event.GetEventName = function(eventId) {
|
||||||
case 0x11 : return 'pause';
|
case 0x11 : return 'pause';
|
||||||
case 0x12 : return 'restart';
|
case 0x12 : return 'restart';
|
||||||
case 0x13 : return 'start';
|
case 0x13 : return 'start';
|
||||||
case 0x14 : return 'test_event';
|
case 0x14 : return 'touch_cancel';
|
||||||
case 0x15 : return 'touch_cancel';
|
case 0x15 : return 'touch_end';
|
||||||
case 0x16 : return 'touch_end';
|
case 0x16 : return 'touch_move';
|
||||||
case 0x17 : return 'touch_move';
|
case 0x17 : return 'touch_start';
|
||||||
case 0x18 : return 'touch_start';
|
|
||||||
default :
|
default :
|
||||||
throw new Error('Event type not defined : ' + eventId);
|
throw new Error('Event type not defined : ' + eventId);
|
||||||
}
|
}
|
||||||
|
@ -1578,12 +1579,12 @@ class Utils {
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -1619,8 +1620,6 @@ class Utils {
|
||||||
- Stop()
|
- Stop()
|
||||||
Stops the system by removing these subscriptions to events
|
Stops the system by removing these subscriptions to events
|
||||||
|
|
||||||
Event.TEST_EVENT
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
class SystemInput extends System {
|
class SystemInput extends System {
|
||||||
|
@ -1647,13 +1646,6 @@ class SystemInput extends System {
|
||||||
*/
|
*/
|
||||||
start() {
|
start() {
|
||||||
|
|
||||||
this.subscriptions.push(
|
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TEST_EVENT,
|
|
||||||
this.OnTestEvent
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log('Test for custom start before');
|
console.log('Test for custom start before');
|
||||||
|
|
||||||
this.started = true;
|
this.started = true;
|
||||||
|
@ -1668,16 +1660,6 @@ class SystemInput extends System {
|
||||||
*/
|
*/
|
||||||
stop() {
|
stop() {
|
||||||
|
|
||||||
this.subscriptions = this.subscriptions.reduce(
|
|
||||||
(result, subscription) => {
|
|
||||||
if (subscription.remove(Event.TEST_EVENT) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
this.started = false;
|
this.started = false;
|
||||||
|
|
||||||
console.log('Stopped transient system: SystemInput');
|
console.log('Stopped transient system: SystemInput');
|
||||||
|
@ -1690,74 +1672,54 @@ class SystemInput extends System {
|
||||||
*/
|
*/
|
||||||
static Start() {
|
static Start() {
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_START'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_START,
|
Event.TOUCH_START,
|
||||||
SystemInput.OnTouchStart
|
SystemInput.OnTouchStart
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_END'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_END,
|
Event.TOUCH_END,
|
||||||
SystemInput.OnTouchEnd
|
SystemInput.OnTouchEnd
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_MOVE'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_MOVE,
|
Event.TOUCH_MOVE,
|
||||||
SystemInput.OnTouchMove
|
SystemInput.OnTouchMove
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_CANCEL'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_CANCEL,
|
Event.TOUCH_CANCEL,
|
||||||
SystemInput.OnTouchCancel
|
SystemInput.OnTouchCancel
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['KEYBOARD_DOWN'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.KEYBOARD_DOWN,
|
Event.KEYBOARD_DOWN,
|
||||||
SystemInput.OnKeyboardDown
|
SystemInput.OnKeyboardDown
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['KEYBOARD_UP'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.KEYBOARD_UP,
|
Event.KEYBOARD_UP,
|
||||||
SystemInput.OnKeyboardUp
|
SystemInput.OnKeyboardUp
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_DOWN'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_DOWN,
|
Event.MOUSE_DOWN,
|
||||||
SystemInput.OnMouseDown
|
SystemInput.OnMouseDown
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_UP'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_UP,
|
Event.MOUSE_UP,
|
||||||
SystemInput.OnMouseUp
|
SystemInput.OnMouseUp
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_MOVE'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_MOVE,
|
Event.MOUSE_MOVE,
|
||||||
SystemInput.OnMouseMove
|
SystemInput.OnMouseMove
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_WHEEL'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_WHEEL,
|
Event.MOUSE_WHEEL,
|
||||||
SystemInput.OnMouseWheel
|
SystemInput.OnMouseWheel
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Started = true;
|
SystemInput.Started = true;
|
||||||
|
@ -1772,105 +1734,35 @@ class SystemInput extends System {
|
||||||
*/
|
*/
|
||||||
static Stop() {
|
static Stop() {
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_START'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_START'];
|
||||||
if (subscription.remove(Event.TOUCH_START) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_END'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_END'];
|
||||||
if (subscription.remove(Event.TOUCH_END) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_MOVE'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_MOVE'];
|
||||||
if (subscription.remove(Event.TOUCH_MOVE) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_CANCEL'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_CANCEL'];
|
||||||
if (subscription.remove(Event.TOUCH_CANCEL) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['KEYBOARD_DOWN'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['KEYBOARD_DOWN'];
|
||||||
if (subscription.remove(Event.KEYBOARD_DOWN) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['KEYBOARD_UP'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['KEYBOARD_UP'];
|
||||||
if (subscription.remove(Event.KEYBOARD_UP) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_DOWN'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_DOWN'];
|
||||||
if (subscription.remove(Event.MOUSE_DOWN) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_UP'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_UP'];
|
||||||
if (subscription.remove(Event.MOUSE_UP) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_MOVE'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_MOVE'];
|
||||||
if (subscription.remove(Event.MOUSE_MOVE) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_WHEEL'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_WHEEL'];
|
||||||
if (subscription.remove(Event.MOUSE_WHEEL) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Started = false;
|
SystemInput.Started = false;
|
||||||
|
|
||||||
|
@ -1878,16 +1770,6 @@ class SystemInput extends System {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* OnTestEvent()
|
|
||||||
* - Listens to events of type Event.TEST_EVENT and executes this function.
|
|
||||||
* @param data (The event data passed as argument - typically an R3Object)
|
|
||||||
* @return null
|
|
||||||
*/
|
|
||||||
OnTestEvent(data) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OnTouchStart()
|
* OnTouchStart()
|
||||||
* - Listens to events of type Event.TOUCH_START and executes this function.
|
* - Listens to events of type Event.TOUCH_START and executes this function.
|
||||||
|
@ -1998,12 +1880,12 @@ class SystemInput extends System {
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -2092,18 +1974,14 @@ class SystemLinking extends System {
|
||||||
*/
|
*/
|
||||||
static Start(options) {
|
static Start(options) {
|
||||||
|
|
||||||
SystemLinking.Subscriptions.push(
|
SystemLinking.Subscriptions['OBJECT_CREATED'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.OBJECT_CREATED,
|
Event.OBJECT_CREATED,
|
||||||
SystemLinking.OnObjectCreated
|
SystemLinking.OnObjectCreated
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemLinking.Subscriptions.push(
|
SystemLinking.Subscriptions['INSTANCE_CREATED'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.INSTANCE_CREATED,
|
Event.INSTANCE_CREATED,
|
||||||
SystemLinking.OnInstanceCreated
|
SystemLinking.OnInstanceCreated
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemLinking.Started = true;
|
SystemLinking.Started = true;
|
||||||
|
@ -2119,25 +1997,11 @@ class SystemLinking extends System {
|
||||||
*/
|
*/
|
||||||
static Stop(options) {
|
static Stop(options) {
|
||||||
|
|
||||||
SystemLinking.Subscriptions = SystemLinking.Subscriptions.reduce(
|
SystemLinking.Subscriptions['OBJECT_CREATED'].remove();
|
||||||
(result, subscription) => {
|
delete SystemLinking.Subscriptions['OBJECT_CREATED'];
|
||||||
if (subscription.remove(Event.OBJECT_CREATED) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemLinking.Subscriptions = SystemLinking.Subscriptions.reduce(
|
SystemLinking.Subscriptions['INSTANCE_CREATED'].remove();
|
||||||
(result, subscription) => {
|
delete SystemLinking.Subscriptions['INSTANCE_CREATED'];
|
||||||
if (subscription.remove(Event.INSTANCE_CREATED) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemLinking.Started = false;
|
SystemLinking.Started = false;
|
||||||
|
|
||||||
|
@ -2175,12 +2039,12 @@ class SystemLinking extends System {
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -2302,12 +2166,12 @@ class SystemSocket extends System {
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "r3",
|
"name": "r3",
|
||||||
"version" : "2.0.163",
|
"version" : "2.0.176",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
14
r3.php
14
r3.php
|
@ -665,7 +665,8 @@ function generateEventListenersStart($file, $tokens)
|
||||||
|
|
||||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||||
|
|
||||||
$updates = str_replace('EVENT_NAME', $item, $template);
|
$updates = str_replace('FULL_EVENT_NAME', $item, $template);
|
||||||
|
$updates = str_replace('EVENT_NAME', $eventName, $updates);
|
||||||
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
||||||
|
|
||||||
$updated .= $updates;
|
$updated .= $updates;
|
||||||
|
@ -693,7 +694,9 @@ function generateEventListenersStop($file, $tokens)
|
||||||
foreach ($store as $item) {
|
foreach ($store as $item) {
|
||||||
$item = trim($item);
|
$item = trim($item);
|
||||||
|
|
||||||
$updates = str_replace('EVENT_NAME', $item, $template);
|
$eventName = preg_replace('/Event./', '', $item);
|
||||||
|
|
||||||
|
$updates = str_replace('EVENT_NAME', $eventName, $template);
|
||||||
|
|
||||||
$updated .= $updates;
|
$updated .= $updates;
|
||||||
}
|
}
|
||||||
|
@ -727,7 +730,8 @@ function generateStaticEventListenersStart($file, $tokens)
|
||||||
|
|
||||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||||
|
|
||||||
$updates = str_replace('EVENT_NAME', $item, $template);
|
$updates = str_replace('FULL_EVENT_NAME', $item, $template);
|
||||||
|
$updates = str_replace('EVENT_NAME', $eventName, $updates);
|
||||||
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
||||||
|
|
||||||
$updated .= $updates;
|
$updated .= $updates;
|
||||||
|
@ -755,7 +759,9 @@ function generateStaticEventListenersStop($file, $tokens)
|
||||||
foreach ($store as $item) {
|
foreach ($store as $item) {
|
||||||
$item = trim($item);
|
$item = trim($item);
|
||||||
|
|
||||||
$updates = str_replace('EVENT_NAME', $item, $template);
|
$eventName = preg_replace('/Event./', '', $item);
|
||||||
|
|
||||||
|
$updates = str_replace('EVENT_NAME', $eventName, $template);
|
||||||
|
|
||||||
$updated .= $updates;
|
$updated .= $updates;
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,6 +262,7 @@ class Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
Event.Subscriptions[eventId][subscriptionId] = callback;
|
Event.Subscriptions[eventId][subscriptionId] = callback;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Event.Subscriptions[eventId] = {};
|
Event.Subscriptions[eventId] = {};
|
||||||
Event.Subscriptions[eventId][subscriptionId] = callback;
|
Event.Subscriptions[eventId][subscriptionId] = callback;
|
||||||
|
@ -289,6 +290,8 @@ class Event {
|
||||||
if (listeners.length === 0) {
|
if (listeners.length === 0) {
|
||||||
delete Event.Subscriptions[eventId];
|
delete Event.Subscriptions[eventId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}(eventId, subscriptionId),
|
}(eventId, subscriptionId),
|
||||||
|
@ -323,12 +326,11 @@ Event.OBJECT_INITIALIZED = 0x10;
|
||||||
Event.PAUSE = 0x11;
|
Event.PAUSE = 0x11;
|
||||||
Event.RESTART = 0x12;
|
Event.RESTART = 0x12;
|
||||||
Event.START = 0x13;
|
Event.START = 0x13;
|
||||||
Event.TEST_EVENT = 0x14;
|
Event.TOUCH_CANCEL = 0x14;
|
||||||
Event.TOUCH_CANCEL = 0x15;
|
Event.TOUCH_END = 0x15;
|
||||||
Event.TOUCH_END = 0x16;
|
Event.TOUCH_MOVE = 0x16;
|
||||||
Event.TOUCH_MOVE = 0x17;
|
Event.TOUCH_START = 0x17;
|
||||||
Event.TOUCH_START = 0x18;
|
Event.MAX_EVENTS = 0x18;
|
||||||
Event.MAX_EVENTS = 0x19;
|
|
||||||
|
|
||||||
Event.GetEventName = function(eventId) {
|
Event.GetEventName = function(eventId) {
|
||||||
|
|
||||||
|
@ -352,11 +354,10 @@ Event.GetEventName = function(eventId) {
|
||||||
case 0x11 : return 'pause';
|
case 0x11 : return 'pause';
|
||||||
case 0x12 : return 'restart';
|
case 0x12 : return 'restart';
|
||||||
case 0x13 : return 'start';
|
case 0x13 : return 'start';
|
||||||
case 0x14 : return 'test_event';
|
case 0x14 : return 'touch_cancel';
|
||||||
case 0x15 : return 'touch_cancel';
|
case 0x15 : return 'touch_end';
|
||||||
case 0x16 : return 'touch_end';
|
case 0x16 : return 'touch_move';
|
||||||
case 0x17 : return 'touch_move';
|
case 0x17 : return 'touch_start';
|
||||||
case 0x18 : return 'touch_start';
|
|
||||||
default :
|
default :
|
||||||
throw new Error('Event type not defined : ' + eventId);
|
throw new Error('Event type not defined : ' + eventId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class R3 {
|
class R3 {
|
||||||
static version = '2.0.163';
|
static version = '2.0.176';
|
||||||
static compileDate = '2021 Sep 06 - 12:30:38 pm';
|
static compileDate = '2021 Sep 06 - 13:04:25 pm';
|
||||||
}
|
}
|
||||||
|
|
||||||
//GENERATED_IMPORTS_START
|
//GENERATED_IMPORTS_START
|
||||||
|
|
|
@ -12,12 +12,12 @@ const System = require('./r3-system.js');
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -131,13 +131,6 @@ class SystemInput extends System {
|
||||||
//GENERATED_START_METHOD_START
|
//GENERATED_START_METHOD_START
|
||||||
|
|
||||||
//GENERATED_EVENT_LISTENERS_START_START
|
//GENERATED_EVENT_LISTENERS_START_START
|
||||||
|
|
||||||
this.subscriptions.push(
|
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TEST_EVENT,
|
|
||||||
this.OnTestEvent
|
|
||||||
)
|
|
||||||
);
|
|
||||||
//GENERATED_EVENT_LISTENERS_START_END
|
//GENERATED_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_SYSTEM_START_START
|
//CUSTOM_BEFORE_SYSTEM_START_START
|
||||||
|
@ -163,15 +156,6 @@ class SystemInput extends System {
|
||||||
//GENERATED_STOP_METHOD_START
|
//GENERATED_STOP_METHOD_START
|
||||||
|
|
||||||
//GENERATED_EVENT_LISTENERS_STOP_START
|
//GENERATED_EVENT_LISTENERS_STOP_START
|
||||||
this.subscriptions = this.subscriptions.reduce(
|
|
||||||
(result, subscription) => {
|
|
||||||
if (subscription.remove(Event.TEST_EVENT) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
//GENERATED_EVENT_LISTENERS_STOP_END
|
//GENERATED_EVENT_LISTENERS_STOP_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_SYSTEM_STOP_START
|
//CUSTOM_BEFORE_SYSTEM_STOP_START
|
||||||
|
@ -199,76 +183,56 @@ class SystemInput extends System {
|
||||||
//GENERATED_STATIC_START_METHOD_START
|
//GENERATED_STATIC_START_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
SystemInput.Subscriptions['TOUCH_START'] = new Event.Subscribe(
|
||||||
SystemInput.Subscriptions.push(
|
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_START,
|
Event.TOUCH_START,
|
||||||
SystemInput.OnTouchStart
|
SystemInput.OnTouchStart
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_END'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_END,
|
Event.TOUCH_END,
|
||||||
SystemInput.OnTouchEnd
|
SystemInput.OnTouchEnd
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_MOVE'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_MOVE,
|
Event.TOUCH_MOVE,
|
||||||
SystemInput.OnTouchMove
|
SystemInput.OnTouchMove
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['TOUCH_CANCEL'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.TOUCH_CANCEL,
|
Event.TOUCH_CANCEL,
|
||||||
SystemInput.OnTouchCancel
|
SystemInput.OnTouchCancel
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['KEYBOARD_DOWN'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.KEYBOARD_DOWN,
|
Event.KEYBOARD_DOWN,
|
||||||
SystemInput.OnKeyboardDown
|
SystemInput.OnKeyboardDown
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['KEYBOARD_UP'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.KEYBOARD_UP,
|
Event.KEYBOARD_UP,
|
||||||
SystemInput.OnKeyboardUp
|
SystemInput.OnKeyboardUp
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_DOWN'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_DOWN,
|
Event.MOUSE_DOWN,
|
||||||
SystemInput.OnMouseDown
|
SystemInput.OnMouseDown
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_UP'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_UP,
|
Event.MOUSE_UP,
|
||||||
SystemInput.OnMouseUp
|
SystemInput.OnMouseUp
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_MOVE'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_MOVE,
|
Event.MOUSE_MOVE,
|
||||||
SystemInput.OnMouseMove
|
SystemInput.OnMouseMove
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemInput.Subscriptions.push(
|
SystemInput.Subscriptions['MOUSE_WHEEL'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.MOUSE_WHEEL,
|
Event.MOUSE_WHEEL,
|
||||||
SystemInput.OnMouseWheel
|
SystemInput.OnMouseWheel
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
@ -294,106 +258,36 @@ class SystemInput extends System {
|
||||||
//GENERATED_STATIC_STOP_METHOD_START
|
//GENERATED_STATIC_STOP_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
||||||
|
SystemInput.Subscriptions['TOUCH_START'].remove();
|
||||||
|
delete SystemInput.Subscriptions['TOUCH_START'];
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_END'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_END'];
|
||||||
if (subscription.remove(Event.TOUCH_START) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_MOVE'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_MOVE'];
|
||||||
if (subscription.remove(Event.TOUCH_END) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['TOUCH_CANCEL'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['TOUCH_CANCEL'];
|
||||||
if (subscription.remove(Event.TOUCH_MOVE) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['KEYBOARD_DOWN'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['KEYBOARD_DOWN'];
|
||||||
if (subscription.remove(Event.TOUCH_CANCEL) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['KEYBOARD_UP'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['KEYBOARD_UP'];
|
||||||
if (subscription.remove(Event.KEYBOARD_DOWN) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_DOWN'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_DOWN'];
|
||||||
if (subscription.remove(Event.KEYBOARD_UP) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_UP'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_UP'];
|
||||||
if (subscription.remove(Event.MOUSE_DOWN) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_MOVE'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_MOVE'];
|
||||||
if (subscription.remove(Event.MOUSE_UP) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
SystemInput.Subscriptions['MOUSE_WHEEL'].remove();
|
||||||
(result, subscription) => {
|
delete SystemInput.Subscriptions['MOUSE_WHEEL'];
|
||||||
if (subscription.remove(Event.MOUSE_MOVE) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemInput.Subscriptions = SystemInput.Subscriptions.reduce(
|
|
||||||
(result, subscription) => {
|
|
||||||
if (subscription.remove(Event.MOUSE_WHEEL) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
||||||
|
@ -412,22 +306,6 @@ class SystemInput extends System {
|
||||||
//GENERATED_STATIC_METHODS_END
|
//GENERATED_STATIC_METHODS_END
|
||||||
|
|
||||||
//GENERATED_EVENT_LISTENER_METHODS_START
|
//GENERATED_EVENT_LISTENER_METHODS_START
|
||||||
|
|
||||||
/**
|
|
||||||
* OnTestEvent()
|
|
||||||
* - Listens to events of type Event.TEST_EVENT and executes this function.
|
|
||||||
* @param data (The event data passed as argument - typically an R3Object)
|
|
||||||
* @return null
|
|
||||||
*/
|
|
||||||
OnTestEvent(data) {
|
|
||||||
|
|
||||||
//GENERATED_ON_TEST_EVENT_METHOD_START
|
|
||||||
//GENERATED_ON_TEST_EVENT_METHOD_END
|
|
||||||
|
|
||||||
//CUSTOM_ON_TEST_EVENT_METHOD_START
|
|
||||||
//CUSTOM_ON_TEST_EVENT_METHOD_END
|
|
||||||
|
|
||||||
}
|
|
||||||
//GENERATED_EVENT_LISTENER_METHODS_END
|
//GENERATED_EVENT_LISTENER_METHODS_END
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENER_METHODS_START
|
//GENERATED_STATIC_EVENT_LISTENER_METHODS_START
|
||||||
|
|
|
@ -12,12 +12,12 @@ const System = require('./r3-system.js');
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -177,20 +177,16 @@ class SystemLinking extends System {
|
||||||
//GENERATED_STATIC_START_METHOD_START
|
//GENERATED_STATIC_START_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
SystemLinking.Subscriptions['OBJECT_CREATED'] = new Event.Subscribe(
|
||||||
SystemLinking.Subscriptions.push(
|
|
||||||
new Event.Subscribe(
|
|
||||||
Event.OBJECT_CREATED,
|
Event.OBJECT_CREATED,
|
||||||
SystemLinking.OnObjectCreated
|
SystemLinking.OnObjectCreated
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SystemLinking.Subscriptions.push(
|
SystemLinking.Subscriptions['INSTANCE_CREATED'] = new Event.Subscribe(
|
||||||
new Event.Subscribe(
|
|
||||||
Event.INSTANCE_CREATED,
|
Event.INSTANCE_CREATED,
|
||||||
SystemLinking.OnInstanceCreated
|
SystemLinking.OnInstanceCreated
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
@ -217,26 +213,12 @@ class SystemLinking extends System {
|
||||||
//GENERATED_STATIC_STOP_METHOD_START
|
//GENERATED_STATIC_STOP_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
||||||
|
SystemLinking.Subscriptions['OBJECT_CREATED'].remove();
|
||||||
|
delete SystemLinking.Subscriptions['OBJECT_CREATED'];
|
||||||
|
|
||||||
SystemLinking.Subscriptions = SystemLinking.Subscriptions.reduce(
|
SystemLinking.Subscriptions['INSTANCE_CREATED'].remove();
|
||||||
(result, subscription) => {
|
delete SystemLinking.Subscriptions['INSTANCE_CREATED'];
|
||||||
if (subscription.remove(Event.OBJECT_CREATED) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemLinking.Subscriptions = SystemLinking.Subscriptions.reduce(
|
|
||||||
(result, subscription) => {
|
|
||||||
if (subscription.remove(Event.INSTANCE_CREATED) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
||||||
|
|
|
@ -12,12 +12,12 @@ const System = require('./r3-system.js');
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -176,6 +176,7 @@ class SystemSocket extends System {
|
||||||
//GENERATED_STATIC_START_METHOD_START
|
//GENERATED_STATIC_START_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
|
|
@ -12,12 +12,12 @@ const System = require('./r3-system.js');
|
||||||
Inherited Properties:
|
Inherited Properties:
|
||||||
|
|
||||||
- started (Default value false)
|
- started (Default value false)
|
||||||
- subscriptions (Default value [])
|
- subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Static Properties:
|
Inherited Static Properties:
|
||||||
|
|
||||||
- Started (Default value false)
|
- Started (Default value false)
|
||||||
- Subscriptions (Default value [])
|
- Subscriptions (Default value {})
|
||||||
|
|
||||||
Inherited Methods:
|
Inherited Methods:
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ class SystemTest extends System {
|
||||||
//GENERATED_STATIC_START_METHOD_START
|
//GENERATED_STATIC_START_METHOD_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
|
|
@ -5,12 +5,12 @@ const Utils = require('.././r3-utils');
|
||||||
|
|
||||||
CUSTOM_OPTIONS_START
|
CUSTOM_OPTIONS_START
|
||||||
started=false
|
started=false
|
||||||
subscriptions=[]
|
subscriptions={}
|
||||||
CUSTOM_OPTIONS_END
|
CUSTOM_OPTIONS_END
|
||||||
|
|
||||||
CUSTOM_STATIC_OPTIONS_START
|
CUSTOM_STATIC_OPTIONS_START
|
||||||
Started=false
|
Started=false
|
||||||
Subscriptions=[]
|
Subscriptions={}
|
||||||
CUSTOM_STATIC_OPTIONS_END
|
CUSTOM_STATIC_OPTIONS_END
|
||||||
|
|
||||||
CUSTOM_EVENT_LISTENERS_START
|
CUSTOM_EVENT_LISTENERS_START
|
||||||
|
@ -43,7 +43,7 @@ class System {
|
||||||
options.started = false;
|
options.started = false;
|
||||||
}
|
}
|
||||||
if (typeof options.subscriptions === 'undefined') {
|
if (typeof options.subscriptions === 'undefined') {
|
||||||
options.subscriptions = [];
|
options.subscriptions = {};
|
||||||
}
|
}
|
||||||
//GENERATED_OPTIONS_INIT_END
|
//GENERATED_OPTIONS_INIT_END
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class System {
|
||||||
|
|
||||||
//GENERATED_STATIC_OPTIONS_INIT_START
|
//GENERATED_STATIC_OPTIONS_INIT_START
|
||||||
System.Started = false;
|
System.Started = false;
|
||||||
System.Subscriptions = [];
|
System.Subscriptions = {};
|
||||||
//GENERATED_STATIC_OPTIONS_INIT_END
|
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||||
|
|
||||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
this.subscriptions['EVENT_NAME'] = new Event.Subscribe(
|
||||||
this.subscriptions.push(
|
FULL_EVENT_NAME,
|
||||||
new Event.Subscribe(
|
SYSTEM_NAME.CALL_BACK
|
||||||
EVENT_NAME,
|
|
||||||
this.CALL_BACK
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
this.subscriptions = this.subscriptions.reduce(
|
this.subscriptions['EVENT_NAME'].remove();
|
||||||
(result, subscription) => {
|
delete this.subscriptions['EVENT_NAME'];
|
||||||
if (subscription.remove(EVENT_NAME) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
SYSTEM_NAME.Subscriptions['EVENT_NAME'] = new Event.Subscribe(
|
||||||
SYSTEM_NAME.Subscriptions.push(
|
FULL_EVENT_NAME,
|
||||||
new Event.Subscribe(
|
|
||||||
EVENT_NAME,
|
|
||||||
SYSTEM_NAME.CALL_BACK
|
SYSTEM_NAME.CALL_BACK
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
|
SYSTEM_NAME.Subscriptions['EVENT_NAME'].remove();
|
||||||
|
delete SYSTEM_NAME.Subscriptions['EVENT_NAME'];
|
||||||
|
|
||||||
SYSTEM_NAME.Subscriptions = SYSTEM_NAME.Subscriptions.reduce(
|
|
||||||
(result, subscription) => {
|
|
||||||
if (subscription.remove(EVENT_NAME) !== true) {
|
|
||||||
result.push(subscription);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||||
|
|
||||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||||
|
|
||||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||||
|
|
|
@ -19,7 +19,6 @@ GENERATED_INDEX_BODY
|
||||||
GENERATED_INHERITED
|
GENERATED_INHERITED
|
||||||
GENERATED_METHOD_NAME_UPPERCASE_METHOD
|
GENERATED_METHOD_NAME_UPPERCASE_METHOD
|
||||||
GENERATED_METHODS
|
GENERATED_METHODS
|
||||||
GENERATED_ON_TEST_EVENT_METHOD
|
|
||||||
GENERATED_OPTIONS_INIT
|
GENERATED_OPTIONS_INIT
|
||||||
GENERATED_START_METHOD
|
GENERATED_START_METHOD
|
||||||
GENERATED_STATIC_ASYNC_METHOD
|
GENERATED_STATIC_ASYNC_METHOD
|
||||||
|
@ -69,7 +68,6 @@ CUSTOM_INSTANCE_OPTIONS_MAPPING
|
||||||
CUSTOM_LINKED_OBJECTS
|
CUSTOM_LINKED_OBJECTS
|
||||||
CUSTOM_METHOD_NAME_UPPERCASE_METHOD
|
CUSTOM_METHOD_NAME_UPPERCASE_METHOD
|
||||||
CUSTOM_METHODS
|
CUSTOM_METHODS
|
||||||
CUSTOM_ON_TEST_EVENT_METHOD
|
|
||||||
CUSTOM_OPTIONS
|
CUSTOM_OPTIONS
|
||||||
CUSTOM_OPTIONS_INIT
|
CUSTOM_OPTIONS_INIT
|
||||||
CUSTOM_OUT_OF_CLASS_IMPLEMENTATION
|
CUSTOM_OUT_OF_CLASS_IMPLEMENTATION
|
||||||
|
|
Loading…
Reference in New Issue