From 967ee31957c553e3b45391a9a762752b5fc443a3 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Fri, 1 Oct 2021 12:40:04 +0200 Subject: [PATCH] all tests passing --- dist/r3.js | 94 ++++++++-------- package.json | 2 +- r3.php | 71 +++++++++++- src/r3/r3-component/r3-component-canvas.js | 3 +- src/r3/r3-component/r3-component-code.js | 4 +- src/r3/r3-component/r3-component-d-o-m.js | 4 +- src/r3/r3-component/r3-component-graphics.js | 4 +- src/r3/r3-component/r3-component-image.js | 4 +- src/r3/r3-component/r3-component-input.js | 4 +- src/r3/r3-component/r3-component-material.js | 3 +- src/r3/r3-component/r3-component-mesh.js | 3 +- src/r3/r3-component/r3-component-texture.js | 3 +- src/r3/r3-component/r3-component-touch.js | 13 ++- src/r3/r3-component/r3-component.js | 1 + src/r3/r3-entity/r3-entity-slider.js | 37 +++--- src/r3/r3-entity/r3-entity.js | 8 +- src/r3/r3-object/r3-object.js | 12 +- src/r3/r3-object/r3-project.js | 8 ++ src/r3/r3-system/r3-system-d-o-m.js | 7 +- src/r3/r3-system/r3-system-input.js | 7 +- src/r3/r3-system/r3-system-linking.js | 61 +++++----- src/r3/r3-system/r3-system-render.js | 7 +- src/r3/r3-system/r3-system-runtime.js | 7 +- src/r3/r3-system/r3-system-socket.js | 7 +- src/r3/r3-system/r3-system-storage.js | 7 +- src/r3/r3-system/r3-system.js | 6 + src/r3/r3.js | 4 +- src/templates/component_extends.template | 2 +- src/templates/entity_base.template | 7 +- src/templates/entity_extends.template | 8 +- .../generated_required_components.template | 4 +- src/templates/object_base.template | 8 +- src/templates/object_extends.template | 6 + src/templates/system_base.template | 6 + src/templates/system_extends.template | 7 +- src/templates/token.db | 1 + test/R3.test.js | 105 +++++++++++++++++- utils.php | 4 + version | 2 +- 39 files changed, 411 insertions(+), 140 deletions(-) diff --git a/dist/r3.js b/dist/r3.js index c5fe63e..a37fdf1 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,7 +1,5 @@ -//GENERATED_SOURCE_START - class R3 { constructor(options) { @@ -19,12 +17,12 @@ class R3 { /** * static Version - Current R3 version */ -R3.Version = '3.0.171'; +R3.Version = '3.0.202'; /** * static CompileDate - Current compile date of R3 */ -R3.CompileDate = '2021 Oct 01 - 08:36:23 am'; +R3.CompileDate = '2021 Oct 01 - 12:39:24 pm'; class System { @@ -601,7 +599,7 @@ class SystemLinking extends System { */ static OnObjectCreated(object) { - console.log('object created'); + console.log('Object created : ' + object.name); } @@ -688,7 +686,7 @@ class SystemLinking extends System { */ static OnObjectPropertyUpdate(object) { - let {value, property} = object; + let {value, property, r3object} = object; // object = object.object; @@ -706,11 +704,11 @@ class SystemLinking extends System { */ if (value.length === 0) { - if (object[property] instanceof Array) { - for (let i = 0; i < object[property].length; i++) { - if (object[property][i] instanceof R3.Object) { - object.dirty = true; - Utils.RemoveFromArray(object[property][i].parents, object); + if (r3object[property] instanceof Array) { + for (let i = 0; i < r3object[property].length; i++) { + if (r3object[property][i] instanceof R3Object) { + r3object.dirty = true; + Utils.RemoveFromArray(r3object[property][i].parents, r3object); } } } @@ -722,16 +720,16 @@ class SystemLinking extends System { */ for (let i = 0; i < value.length; i++) { - if (value[i] instanceof R3.Object) { - Utils.PushUnique(value[i].parents, object); + if (value[i] instanceof R3Object) { + Utils.PushUnique(value[i].parents, r3object); } } } } - if (value instanceof R3.Object) { - Utils.PushUnique(value.parents, object); + if (value instanceof R3Object) { + Utils.PushUnique(value.parents, r3object); } /** @@ -739,23 +737,23 @@ class SystemLinking extends System { * components (if available) */ if (value === null || typeof value === 'undefined') { - if (object[property] instanceof R3.Object) { - object.dirty = true; - Utils.RemoveFromArray(object[property].parents, object); + if (r3object[property] instanceof R3Object) { + r3object.dirty = true; + Utils.RemoveFromArray(r3object[property].parents, r3object); } } - if (!object.underConstruction) { + if (!r3object.underConstruction) { - if (object.initialized) { + if (r3object.initialized) { /** * Check if this object will still be initialized after this assignment completes */ - object.setInitialized(property, value); - if (!object.initialized) { + r3object.setInitialized(property, value); + if (!r3object.initialized) { //We set this object back to initialized because it is still initialized - it WILL be not initialized in the future - object.initialized = true; - object.stop(); + r3object.initialized = true; + r3object.stop(); } } } @@ -770,9 +768,9 @@ class SystemLinking extends System { */ static OnObjectPropertyUpdated(object) { - // let {object} = object; + let {r3object} = object; - if (!object.underConstruction) { + if (!r3object.underConstruction) { /** * At this point - the object entity would have been brought to a stop @@ -781,12 +779,12 @@ class SystemLinking extends System { * We can safely clear the dirty flag. */ - if (object.dirty) { - object.dirty = false; + if (r3object.dirty) { + r3object.dirty = false; } - object.initializeDepth = 0; - object.initialize(); + r3object.initializeDepth = 0; + r3object.initialize(); } } @@ -2639,7 +2637,7 @@ class R3Object extends Event { * name - Each Object has a name */ if (typeof options.name === 'undefined') { - options.name = 'Object ' + options.id; + options.name = this.constructor.name + '(' + options.id + ')'; } /** * dirty - When dirty is true, it means that this object is in transition from having a child Object to @@ -3248,9 +3246,9 @@ Entity.MAX_ENTITY = 0x1; - images=[R3.Image] - We need a list of at least one Image which to slide - canvas=R3.Canvas - We need a Canvas to attach our Input events - touch=R3.Touch - We need a Touch Component to respond to TOUCH Events + images=[Image] - We need a list of at least one Image which to slide + canvas=Canvas - We need a Canvas to attach our Input events + touch=Touch - We need a Touch Component to respond to TOUCH Events **/ @@ -3334,7 +3332,7 @@ class EntitySlider extends Entity { /** * images - We need a list of at least one Image which to slide */ - options.required.images = [R3.Image]; + options.required.images = [Image]; this.imagesBackup = options.images; Object.defineProperty( this, @@ -3346,7 +3344,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'images', value : x } @@ -3355,7 +3353,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'images', value : x } @@ -3369,7 +3367,7 @@ class EntitySlider extends Entity { ) /** * canvas - We need a Canvas to attach our Input events */ - options.required.canvas = R3.Canvas; + options.required.canvas = Canvas; this.canvasBackup = options.canvas; Object.defineProperty( this, @@ -3381,7 +3379,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -3390,7 +3388,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -3404,7 +3402,7 @@ class EntitySlider extends Entity { ) /** * touch - We need a Touch Component to respond to TOUCH Events */ - options.required.touch = R3.Touch; + options.required.touch = Touch; this.touchBackup = options.touch; Object.defineProperty( this, @@ -3416,7 +3414,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'touch', value : x } @@ -3425,7 +3423,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'touch', value : x } @@ -6221,7 +6219,7 @@ class ComponentInput extends Component { - canvas=R3.Canvas + canvas=ComponentCanvas **/ @@ -6264,7 +6262,7 @@ class ComponentTouch extends ComponentInput { /** * canvas - No comment */ - options.required.canvas = R3.Canvas; + options.required.canvas = ComponentCanvas; this.canvasBackup = options.canvas; Object.defineProperty( this, @@ -6276,7 +6274,7 @@ class ComponentTouch extends ComponentInput { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -6285,7 +6283,7 @@ class ComponentTouch extends ComponentInput { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -7587,8 +7585,6 @@ class Utils { } -//GENERATED_SOURCE_END - console.log('r3.js - version ' + R3.Version + ' compiled ' + R3.CompileDate); Component.Code = ComponentCode; diff --git a/package.json b/package.json index c254340..f4a07c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version": "3.0.171", + "version": "3.0.202", "description": "", "private": true, "dependencies": { diff --git a/r3.php b/r3.php index 7af3f69..fd2bd6e 100755 --- a/r3.php +++ b/r3.php @@ -1308,6 +1308,45 @@ function generateStaticEventListenerMethods($file, $tokens) } +function generateImports($file, $tokens, $command) +{ + + $updates = []; + + if ( + array_key_exists('CUSTOM_REQUIRED_COMPONENTS', $tokens) && + sizeof($tokens['CUSTOM_REQUIRED_COMPONENTS']) > 0 + ) { + array_push($updates, "const Event = require('../r3-event.js');\n"); + } + + if ( + array_key_exists('TEMPLATE_METHODS', $tokens) && + sizeof($tokens['TEMPLATE_METHODS']) > 0 + ) { + foreach ($tokens['TEMPLATE_METHODS'] as $method) { + if (preg_match('/initialize\(\)/', $method)) { + + if (!preg_match('/ Component/', $command)) { + array_push($updates, "const Component = require('../r3-component/r3-component.js');\n"); + } + + if (!preg_match('/ Entity /', $command)) { + array_push($updates, "const Entity = require('../r3-entity/r3-entity.js');\n"); + } + } + } + } + + if (sizeof($updates) === 0) { + return; + } + + updateSection($file, 'GENERATED_IMPORTS', $updates); + +} + + function generateMethods($file, $tokens, $token, $section) { @@ -1323,7 +1362,7 @@ function generateMethods($file, $tokens, $token, $section) } -function buildImportsAndBody(&$imports, &$body, $node, $type, $nameSpace) +function buildImportsAndBody(&$imports, &$body, &$tests, &$testImports, $node, $type, $nameSpace) { $originalNameSpace = $nameSpace; @@ -1333,13 +1372,26 @@ function buildImportsAndBody(&$imports, &$body, $node, $type, $nameSpace) $nameSpace = $originalNameSpace . '.' . $child->nameSpaceClassName; $file = str_replace('src/r3/r3-' . str_replace('r3-', '', strtolower(from_camel_case($type,'-'))), '.', $child->file); - $file = preg_replace('/src\/r3/','..',$file); + + $important = true; + + if (preg_match('/src\/r3/', $file)) { + $important = false; + $file = preg_replace('/src\/r3/','..',$file); + } + array_push($imports, "const " . $child->name . ' = require(\'' . $file . "');"); array_push($body, "$nameSpace = " . $child->name . ';'); + + if ($important) { + array_push($testImports, "const " . $child->name . ' = require(\'../src/r3/r3-' . str_replace('r3object','object', strtolower($type)) . '/' . $file . "');"); + array_push($tests, "\t\t\tconst " . lcfirst($child->name) . " = new " . $child->name . '();'); + } + $child->nameSpace = $nameSpace; - buildImportsAndBody($imports, $body, $child, $type, $nameSpace); + buildImportsAndBody($imports, $body, $tests, $testImports, $child, $type, $nameSpace); } } @@ -1355,8 +1407,10 @@ function generateIndex($types) foreach ($types as $type) { $imports = []; + $testImports = []; $body = []; $exports = []; + $tests = []; $nodes = $graph->walk(); @@ -1368,7 +1422,7 @@ function generateIndex($types) array_push($imports, "const " . $node->name . ' = require(\'' . $file . "');"); - buildImportsAndBody($imports, $body, $node, $type, $type); + buildImportsAndBody($imports, $body, $tests, $testImports,$node, $type, $type); } } @@ -1382,6 +1436,11 @@ function generateIndex($types) updateSection($indexFile, 'GENERATED_IMPORTS', implode("\n", $imports)); updateSection($indexFile, 'GENERATED_INDEX_BODY', implode("\n", $body)); updateSection($indexFile, 'GENERATED_EXPORTS', implode("\n", $exports)); + + $testFile = 'test/R3.test.js'; + updateSection($testFile, 'GENERATED_' . to_upper_underscore($type) . '_CREATE', implode("\n", $tests)); + updateSection($testFile, 'GENERATED_' . to_upper_underscore($type) . '_IMPORTS', implode("\n", $testImports)); + } } @@ -1659,7 +1718,7 @@ function generateR3Dist($nodes) fclose($r3jsDistPointer); - deleteSavedFile($indexFile . '.saved'); + deleteSavedFile($r3jsIndex . '.saved'); /** * Now start cleaning up the file @@ -1984,6 +2043,8 @@ foreach ($files as $file) { echo "Generating Methods\n"; + generateImports($file, $tokens, $argv[3]); + generateMethods($file, $tokens, 'TEMPLATE_METHODS', 'GENERATED_TEMPLATE_METHODS'); generateMethods($file, $tokens, 'CUSTOM_METHODS', 'GENERATED_METHODS'); diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index be07051..7a9786a 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -1,10 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentDOM = require('./r3-component-d-o-m.js'); /** diff --git a/src/r3/r3-component/r3-component-code.js b/src/r3/r3-component/r3-component-code.js index 739840f..23c28e2 100644 --- a/src/r3/r3-component/r3-component-code.js +++ b/src/r3/r3-component/r3-component-code.js @@ -1,11 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); -const Component = require('./r3-component.js'); +const Component = require('../r3-component/r3-component.js'); /** diff --git a/src/r3/r3-component/r3-component-d-o-m.js b/src/r3/r3-component/r3-component-d-o-m.js index f1b368f..aa85faa 100644 --- a/src/r3/r3-component/r3-component-d-o-m.js +++ b/src/r3/r3-component/r3-component-d-o-m.js @@ -1,11 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); -const Component = require('./r3-component.js'); +const Component = require('../r3-component/r3-component.js'); /** diff --git a/src/r3/r3-component/r3-component-graphics.js b/src/r3/r3-component/r3-component-graphics.js index a870354..7ec61e3 100644 --- a/src/r3/r3-component/r3-component-graphics.js +++ b/src/r3/r3-component/r3-component-graphics.js @@ -1,11 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); -const Component = require('./r3-component.js'); +const Component = require('../r3-component/r3-component.js'); /** diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index 2b9ba62..3967861 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -1,10 +1,12 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START +const Utils = require('../r3-utils.js'); //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentGraphics = require('./r3-component-graphics.js'); /** diff --git a/src/r3/r3-component/r3-component-input.js b/src/r3/r3-component/r3-component-input.js index 3d08db6..1278d26 100644 --- a/src/r3/r3-component/r3-component-input.js +++ b/src/r3/r3-component/r3-component-input.js @@ -1,11 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); -const Component = require('./r3-component.js'); +const Component = require('../r3-component/r3-component.js'); /** diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 7307776..7d3c48e 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -1,10 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentGraphics = require('./r3-component-graphics.js'); /** diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index e69ff7a..c7a3a90 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -1,10 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentGraphics = require('./r3-component-graphics.js'); /** diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index f95ce5c..d9596ea 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -1,10 +1,11 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentGraphics = require('./r3-component-graphics.js'); /** diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index e9b7820..f3a5854 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -1,10 +1,13 @@ //GENERATED_IMPORTS_START +const Event = require('../r3-event.js'); +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START +const ComponentCanvas = require('../r3-component/r3-component-canvas.js'); //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const ComponentInput = require('./r3-component-input.js'); /** @@ -131,7 +134,7 @@ const ComponentInput = require('./r3-component-input.js'); CUSTOM_OPTIONS_END CUSTOM_REQUIRED_COMPONENTS_START - canvas=R3.Canvas + canvas=ComponentCanvas CUSTOM_REQUIRED_COMPONENTS_END TEMPLATE_STATIC_OPTIONS_START @@ -215,7 +218,7 @@ class ComponentTouch extends ComponentInput { /** * canvas - No comment */ - options.required.canvas = R3.Canvas; + options.required.canvas = ComponentCanvas; this.canvasBackup = options.canvas; Object.defineProperty( this, @@ -227,7 +230,7 @@ class ComponentTouch extends ComponentInput { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -236,7 +239,7 @@ class ComponentTouch extends ComponentInput { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'canvas', value : x } diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index d3c9883..a184bda 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -1,4 +1,5 @@ //GENERATED_IMPORTS_START +const Entity = require('../r3-entity/r3-entity.js'); //GENERATED_IMPORTS_END //CUSTOM_IMPORTS_START diff --git a/src/r3/r3-entity/r3-entity-slider.js b/src/r3/r3-entity/r3-entity-slider.js index e0e9763..c497b26 100644 --- a/src/r3/r3-entity/r3-entity-slider.js +++ b/src/r3/r3-entity/r3-entity-slider.js @@ -1,5 +1,14 @@ -const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); +//GENERATED_IMPORTS_START +const Event = require('../r3-event.js'); +const Component = require('../r3-component/r3-component.js'); +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +const Image = require('../r3-component/r3-component-image.js'); +const Canvas = require('../r3-component/r3-component-canvas.js'); +const Touch = require('../r3-component/r3-component-touch.js'); +//CUSTOM_IMPORTS_END + const Entity = require('./r3-entity.js'); /** @@ -119,9 +128,9 @@ const Entity = require('./r3-entity.js'); CUSTOM_OPTIONS_END CUSTOM_REQUIRED_COMPONENTS_START - images=[R3.Image] - We need a list of at least one Image which to slide - canvas=R3.Canvas - We need a Canvas to attach our Input events - touch=R3.Touch - We need a Touch Component to respond to TOUCH Events + images=[Image] - We need a list of at least one Image which to slide + canvas=Canvas - We need a Canvas to attach our Input events + touch=Touch - We need a Touch Component to respond to TOUCH Events CUSTOM_REQUIRED_COMPONENTS_END TEMPLATE_STATIC_OPTIONS_START @@ -240,7 +249,7 @@ class EntitySlider extends Entity { /** * images - We need a list of at least one Image which to slide */ - options.required.images = [R3.Image]; + options.required.images = [Image]; this.imagesBackup = options.images; Object.defineProperty( this, @@ -252,7 +261,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'images', value : x } @@ -261,7 +270,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'images', value : x } @@ -275,7 +284,7 @@ class EntitySlider extends Entity { ) /** * canvas - We need a Canvas to attach our Input events */ - options.required.canvas = R3.Canvas; + options.required.canvas = Canvas; this.canvasBackup = options.canvas; Object.defineProperty( this, @@ -287,7 +296,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -296,7 +305,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'canvas', value : x } @@ -310,7 +319,7 @@ class EntitySlider extends Entity { ) /** * touch - We need a Touch Component to respond to TOUCH Events */ - options.required.touch = R3.Touch; + options.required.touch = Touch; this.touchBackup = options.touch; Object.defineProperty( this, @@ -322,7 +331,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'touch', value : x } @@ -331,7 +340,7 @@ class EntitySlider extends Entity { Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'touch', value : x } diff --git a/src/r3/r3-entity/r3-entity.js b/src/r3/r3-entity/r3-entity.js index c801231..a84a7aa 100644 --- a/src/r3/r3-entity/r3-entity.js +++ b/src/r3/r3-entity/r3-entity.js @@ -1,5 +1,11 @@ +//GENERATED_IMPORTS_START +const Component = require('../r3-component/r3-component.js'); +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const R3Object = require('../r3-object/r3-object.js'); /** diff --git a/src/r3/r3-object/r3-object.js b/src/r3/r3-object/r3-object.js index f671d12..6c88778 100644 --- a/src/r3/r3-object/r3-object.js +++ b/src/r3/r3-object/r3-object.js @@ -1,3 +1,11 @@ +//GENERATED_IMPORTS_START +const Component = require('../r3-component/r3-component.js'); +const Entity = require('../r3-entity/r3-entity.js'); +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); @@ -64,7 +72,7 @@ const Utils = require('.././r3-utils'); TEMPLATE_OPTIONS_START id=Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely identifies it everywhere (client and server side) - name='Object ' + options.id - Each Object has a name + name=this.constructor.name + '(' + options.id + ')' - Each Object has a name dirty=false - When dirty is true, it means that this object is in transition from having a child Object to not having this child Object, and will probably end up in an uninitialized state. During the next few clock cycles this child Object will have its parent reference to this Object removed. initialized=false - A boolean which indicates whether or not this Object has initialized initializeDepth=0 - The amount of times this Object passed through initialize() functions @@ -129,7 +137,7 @@ class R3Object extends Event { * name - Each Object has a name */ if (typeof options.name === 'undefined') { - options.name = 'Object ' + options.id; + options.name = this.constructor.name + '(' + options.id + ')'; } /** * dirty - When dirty is true, it means that this object is in transition from having a child Object to diff --git a/src/r3/r3-object/r3-project.js b/src/r3/r3-object/r3-project.js index b480814..814f2d4 100644 --- a/src/r3/r3-object/r3-project.js +++ b/src/r3/r3-object/r3-project.js @@ -1,3 +1,11 @@ +//GENERATED_IMPORTS_START +const Component = require('../r3-component/r3-component.js'); +const Entity = require('../r3-entity/r3-entity.js'); +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); const R3Object = require('./r3-object.js'); 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 71eec4c..7c25cf7 100644 --- a/src/r3/r3-system/r3-system-d-o-m.js +++ b/src/r3/r3-system/r3-system-d-o-m.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index 28210f0..b797f6a 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index 084090f..fa1fe77 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -1,5 +1,12 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +const R3Object = require('../r3-object/r3-object.js'); +const Utils = require('../r3-utils.js'); +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** @@ -254,7 +261,7 @@ class SystemLinking extends System { //GENERATED_STATIC_ON_OBJECT_CREATED_METHOD_END //CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD_START - console.log('object created'); + console.log('Object created : ' + object.name); //CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD_END } @@ -366,7 +373,7 @@ class SystemLinking extends System { //GENERATED_STATIC_ON_OBJECT_PROPERTY_UPDATE_METHOD_END //CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATE_METHOD_START - let {value, property} = object; + let {value, property, r3object} = object; // object = object.object; @@ -384,11 +391,11 @@ class SystemLinking extends System { */ if (value.length === 0) { - if (object[property] instanceof Array) { - for (let i = 0; i < object[property].length; i++) { - if (object[property][i] instanceof R3.Object) { - object.dirty = true; - Utils.RemoveFromArray(object[property][i].parents, object); + if (r3object[property] instanceof Array) { + for (let i = 0; i < r3object[property].length; i++) { + if (r3object[property][i] instanceof R3Object) { + r3object.dirty = true; + Utils.RemoveFromArray(r3object[property][i].parents, r3object); } } } @@ -400,16 +407,16 @@ class SystemLinking extends System { */ for (let i = 0; i < value.length; i++) { - if (value[i] instanceof R3.Object) { - Utils.PushUnique(value[i].parents, object); + if (value[i] instanceof R3Object) { + Utils.PushUnique(value[i].parents, r3object); } } } } - if (value instanceof R3.Object) { - Utils.PushUnique(value.parents, object); + if (value instanceof R3Object) { + Utils.PushUnique(value.parents, r3object); } /** @@ -417,23 +424,23 @@ class SystemLinking extends System { * components (if available) */ if (value === null || typeof value === 'undefined') { - if (object[property] instanceof R3.Object) { - object.dirty = true; - Utils.RemoveFromArray(object[property].parents, object); + if (r3object[property] instanceof R3Object) { + r3object.dirty = true; + Utils.RemoveFromArray(r3object[property].parents, r3object); } } - if (!object.underConstruction) { + if (!r3object.underConstruction) { - if (object.initialized) { + if (r3object.initialized) { /** * Check if this object will still be initialized after this assignment completes */ - object.setInitialized(property, value); - if (!object.initialized) { + r3object.setInitialized(property, value); + if (!r3object.initialized) { //We set this object back to initialized because it is still initialized - it WILL be not initialized in the future - object.initialized = true; - object.stop(); + r3object.initialized = true; + r3object.stop(); } } } @@ -454,9 +461,9 @@ class SystemLinking extends System { //GENERATED_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_END //CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_START - // let {object} = object; + let {r3object} = object; - if (!object.underConstruction) { + if (!r3object.underConstruction) { /** * At this point - the object entity would have been brought to a stop @@ -465,12 +472,12 @@ class SystemLinking extends System { * We can safely clear the dirty flag. */ - if (object.dirty) { - object.dirty = false; + if (r3object.dirty) { + r3object.dirty = false; } - object.initializeDepth = 0; - object.initialize(); + r3object.initializeDepth = 0; + r3object.initialize(); } //CUSTOM_STATIC_ON_OBJECT_PROPERTY_UPDATED_METHOD_END diff --git a/src/r3/r3-system/r3-system-render.js b/src/r3/r3-system/r3-system-render.js index 47a5cf6..451a192 100644 --- a/src/r3/r3-system/r3-system-render.js +++ b/src/r3/r3-system/r3-system-render.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system-runtime.js b/src/r3/r3-system/r3-system-runtime.js index 4148189..a1e4ed8 100644 --- a/src/r3/r3-system/r3-system-runtime.js +++ b/src/r3/r3-system/r3-system-runtime.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system-socket.js b/src/r3/r3-system/r3-system-socket.js index 3e900d8..9f96f8c 100644 --- a/src/r3/r3-system/r3-system-socket.js +++ b/src/r3/r3-system/r3-system-socket.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system-storage.js b/src/r3/r3-system/r3-system-storage.js index 6cf89b1..5b1275f 100644 --- a/src/r3/r3-system/r3-system-storage.js +++ b/src/r3/r3-system/r3-system-storage.js @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); const System = require('./r3-system.js'); /** diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index faf50c3..7f7f9af 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -1,3 +1,9 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); diff --git a/src/r3/r3.js b/src/r3/r3.js index 47f35c2..53baf9e 100644 --- a/src/r3/r3.js +++ b/src/r3/r3.js @@ -90,12 +90,12 @@ class R3 { /** * static Version - Current R3 version */ -R3.Version = '3.0.171'; +R3.Version = '3.0.202'; /** * static CompileDate - Current compile date of R3 */ -R3.CompileDate = '2021 Oct 01 - 08:36:23 am'; +R3.CompileDate = '2021 Oct 01 - 12:39:24 pm'; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/templates/component_extends.template b/src/templates/component_extends.template index 89bff82..392bdf2 100644 --- a/src/templates/component_extends.template +++ b/src/templates/component_extends.template @@ -4,7 +4,7 @@ //CUSTOM_IMPORTS_START //CUSTOM_IMPORTS_END -const Entity = require('../r3-entity/r3-entity.js'); +const Component = require('../r3-component/r3-component.js'); const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); /** diff --git a/src/templates/entity_base.template b/src/templates/entity_base.template index 9e7fe95..6268bf6 100644 --- a/src/templates/entity_base.template +++ b/src/templates/entity_base.template @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('INCLUDE_PATH/r3-event'); -const Utils = require('INCLUDE_PATH/r3-utils'); const R3Object = require('../r3-object/r3-object.js'); /** diff --git a/src/templates/entity_extends.template b/src/templates/entity_extends.template index 9a532c2..2f8dbcd 100644 --- a/src/templates/entity_extends.template +++ b/src/templates/entity_extends.template @@ -1,5 +1,9 @@ -const Event = require('INCLUDE_PATH/r3-event'); -const Utils = require('INCLUDE_PATH/r3-utils'); +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); /** diff --git a/src/templates/generated_required_components.template b/src/templates/generated_required_components.template index 9f07776..ce762f2 100644 --- a/src/templates/generated_required_components.template +++ b/src/templates/generated_required_components.template @@ -13,7 +13,7 @@ Event.Emit( Event.OBJECT_PROPERTY_UPDATE, { - object : this, + r3object : this, property : 'KEY', value : x } @@ -22,7 +22,7 @@ Event.Emit( Event.OBJECT_PROPERTY_UPDATED, { - object : this, + r3object : this, property : 'KEY', value : x } diff --git a/src/templates/object_base.template b/src/templates/object_base.template index 08c0a39..150cabe 100644 --- a/src/templates/object_base.template +++ b/src/templates/object_base.template @@ -1,3 +1,9 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('INCLUDE_PATH/r3-event'); const Utils = require('INCLUDE_PATH/r3-utils'); @@ -9,7 +15,7 @@ const Utils = require('INCLUDE_PATH/r3-utils'); TEMPLATE_OPTIONS_START id=Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely identifies it everywhere (client and server side) - name='Object ' + options.id - Each Object has a name + name=this.constructor.name + '(' + options.id + ')' - Each Object has a name dirty=false - When dirty is true, it means that this object is in transition from having a child Object to not having this child Object, and will probably end up in an uninitialized state. During the next few clock cycles this child Object will have its parent reference to this Object removed. initialized=false - A boolean which indicates whether or not this Object has initialized initializeDepth=0 - The amount of times this Object passed through initialize() functions diff --git a/src/templates/object_extends.template b/src/templates/object_extends.template index 6e8f0d2..4124a4c 100644 --- a/src/templates/object_extends.template +++ b/src/templates/object_extends.template @@ -1,3 +1,9 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('INCLUDE_PATH/r3-event'); const Utils = require('INCLUDE_PATH/r3-utils'); const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); diff --git a/src/templates/system_base.template b/src/templates/system_base.template index c116c41..d859220 100644 --- a/src/templates/system_base.template +++ b/src/templates/system_base.template @@ -1,3 +1,9 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('INCLUDE_PATH/r3-event'); const Utils = require('INCLUDE_PATH/r3-utils'); diff --git a/src/templates/system_extends.template b/src/templates/system_extends.template index 56c3781..8b0498d 100644 --- a/src/templates/system_extends.template +++ b/src/templates/system_extends.template @@ -1,5 +1,10 @@ +//GENERATED_IMPORTS_START +//GENERATED_IMPORTS_END + +//CUSTOM_IMPORTS_START +//CUSTOM_IMPORTS_END + const Event = require('INCLUDE_PATH/r3-event'); -const Utils = require('INCLUDE_PATH/r3-utils'); const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME'); /** diff --git a/src/templates/token.db b/src/templates/token.db index 0953108..93c6d3f 100644 --- a/src/templates/token.db +++ b/src/templates/token.db @@ -40,6 +40,7 @@ GENERATED_SET_INITIALIZED_METHOD GENERATED_SET_INITIALIZED_METHOD_AFTER GENERATED_SET_RUNTIME_METHOD GENERATED_SET_RUNTIME_METHOD_AFTER +GENERATED_SOURCE GENERATED_START_METHOD GENERATED_START_METHOD_AFTER GENERATED_STATIC_ASYNC_METHOD diff --git a/test/R3.test.js b/test/R3.test.js index fd7eeb1..609de29 100644 --- a/test/R3.test.js +++ b/test/R3.test.js @@ -1,6 +1,46 @@ const {assert} = require('chai'); const Event = require('../src/r3/r3-event.js'); +//GENERATED_COMPONENT_IMPORTS_START +const ComponentCode = require('../src/r3/r3-component/./r3-component-code.js'); +const ComponentDOM = require('../src/r3/r3-component/./r3-component-d-o-m.js'); +const ComponentCanvas = require('../src/r3/r3-component/./r3-component-canvas.js'); +const ComponentGraphics = require('../src/r3/r3-component/./r3-component-graphics.js'); +const ComponentImage = require('../src/r3/r3-component/./r3-component-image.js'); +const ComponentMaterial = require('../src/r3/r3-component/./r3-component-material.js'); +const ComponentMesh = require('../src/r3/r3-component/./r3-component-mesh.js'); +const ComponentTexture = require('../src/r3/r3-component/./r3-component-texture.js'); +const ComponentInput = require('../src/r3/r3-component/./r3-component-input.js'); +const ComponentTouch = require('../src/r3/r3-component/./r3-component-touch.js'); +//GENERATED_COMPONENT_IMPORTS_END + +//GENERATED_ENTITY_IMPORTS_START +const EntitySlider = require('../src/r3/r3-entity/./r3-entity-slider.js'); +//GENERATED_ENTITY_IMPORTS_END + +//GENERATED_RUNTIME_IMPORTS_START +const RuntimeCoder = require('../src/r3/r3-runtime/./r3-runtime-coder.js'); +const RuntimeCodeMirror = require('../src/r3/r3-runtime/./r3-runtime-code-mirror.js'); +const RuntimeDOM = require('../src/r3/r3-runtime/./r3-runtime-d-o-m.js'); +const RuntimeDocument = require('../src/r3/r3-runtime/./r3-runtime-document.js'); +const RuntimeGUI = require('../src/r3/r3-runtime/./r3-runtime-g-u-i.js'); +const RuntimeControlKit = require('../src/r3/r3-runtime/./r3-runtime-control-kit.js'); +const RuntimeGraphics = require('../src/r3/r3-runtime/./r3-runtime-graphics.js'); +const RuntimeThree = require('../src/r3/r3-runtime/./r3-runtime-three.js'); +const RuntimeImage = require('../src/r3/r3-runtime/./r3-runtime-image.js'); +const RuntimeNodeJSImage = require('../src/r3/r3-runtime/./r3-runtime-node-j-s-image.js'); +const RuntimeWebImage = require('../src/r3/r3-runtime/./r3-runtime-web-image.js'); +const RuntimePhysics = require('../src/r3/r3-runtime/./r3-runtime-physics.js'); +const RuntimeBullet = require('../src/r3/r3-runtime/./r3-runtime-bullet.js'); +const RuntimeSocket = require('../src/r3/r3-runtime/./r3-runtime-socket.js'); +const RuntimeStatistics = require('../src/r3/r3-runtime/./r3-runtime-statistics.js'); +const RuntimeStats = require('../src/r3/r3-runtime/./r3-runtime-stats.js'); +//GENERATED_RUNTIME_IMPORTS_END + +//GENERATED_R3_OBJECT_IMPORTS_START +const Project = require('../src/r3/r3-object/./r3-project.js'); +//GENERATED_R3_OBJECT_IMPORTS_END + describe('R3 Tests', () => { it ( @@ -22,13 +62,66 @@ describe('R3 Tests', () => { 'Creation of all components succeed', () => { - const Component = require('../src/r3/r3-component'); + //GENERATED_COMPONENT_CREATE_START + const componentCode = new ComponentCode(); + const componentDOM = new ComponentDOM(); + const componentCanvas = new ComponentCanvas(); + const componentGraphics = new ComponentGraphics(); + const componentImage = new ComponentImage(); + const componentMaterial = new ComponentMaterial(); + const componentMesh = new ComponentMesh(); + const componentTexture = new ComponentTexture(); + const componentInput = new ComponentInput(); + const componentTouch = new ComponentTouch(); + //GENERATED_COMPONENT_CREATE_END - for (let Constructor in Component) { - if (Component.hasOwnProperty(Constructor) && typeof Component[Constructor] === 'function') { - let component = new Component[Constructor](); - } - } + } + ); + + it ( + 'Creation of all entities succeed', + () => { + + //GENERATED_ENTITY_CREATE_START + const entitySlider = new EntitySlider(); + //GENERATED_ENTITY_CREATE_END + + } + ); + + it ( + 'Creation of all runtimes succeed', + () => { + + //GENERATED_RUNTIME_CREATE_START + const runtimeCoder = new RuntimeCoder(); + const runtimeCodeMirror = new RuntimeCodeMirror(); + const runtimeDOM = new RuntimeDOM(); + const runtimeDocument = new RuntimeDocument(); + const runtimeGUI = new RuntimeGUI(); + const runtimeControlKit = new RuntimeControlKit(); + const runtimeGraphics = new RuntimeGraphics(); + const runtimeThree = new RuntimeThree(); + const runtimeImage = new RuntimeImage(); + const runtimeNodeJSImage = new RuntimeNodeJSImage(); + const runtimeWebImage = new RuntimeWebImage(); + const runtimePhysics = new RuntimePhysics(); + const runtimeBullet = new RuntimeBullet(); + const runtimeSocket = new RuntimeSocket(); + const runtimeStatistics = new RuntimeStatistics(); + const runtimeStats = new RuntimeStats(); + //GENERATED_RUNTIME_CREATE_END + + } + ); + + it ( + 'Creation of all objects succeed', + () => { + + //GENERATED_R3_OBJECT_CREATE_START + const project = new Project(); + //GENERATED_R3_OBJECT_CREATE_END } ); diff --git a/utils.php b/utils.php index b3b2fc9..b0f27ac 100644 --- a/utils.php +++ b/utils.php @@ -21,6 +21,10 @@ function from_camel_case($input, $seperator = '_') { return implode($seperator, $ret); } +function to_upper_underscore($input, $seperator = '_') { + return strtoupper(from_camel_case($input, $seperator)); +} + if (isset($argc)) { for ($i = 0; $i < $argc; $i++) { // echo "Argument #" . $i . " - " . $argv[$i] . "\n"; diff --git a/version b/version index 3cda1fe..b0e780d 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.0.171 \ No newline at end of file +3.0.202 \ No newline at end of file