@urso/core 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -1,5 +1,7 @@
1
1
  class ModulesAssetsBaseModel {
2
2
  constructor(params) {
3
+ this.simpleClass = true;
4
+
3
5
  this.setupParams(params);
4
6
  this._templatePath = false;
5
7
  }
@@ -5,6 +5,7 @@ class ModulesInstancesController {
5
5
  constructor() {
6
6
  this._modes = [];
7
7
  this._cache = {};
8
+ this._counter = 0;
8
9
 
9
10
  this.getInstance = this.getInstance.bind(this);
10
11
  this.getByPath = this.getByPath.bind(this);
@@ -73,6 +74,8 @@ class ModulesInstancesController {
73
74
  if (instance.singleton)
74
75
  classObject._instance = instance;
75
76
 
77
+ instance._iuid = this._getUid();
78
+
76
79
  this._launchDefaultFunctions(instance);
77
80
 
78
81
  return instance;
@@ -81,6 +84,11 @@ class ModulesInstancesController {
81
84
  return this._findClass({ path, callback, noModes, modeName });
82
85
  }
83
86
 
87
+ _getUid() {
88
+ this._counter++;
89
+ return 'instance' + this._counter;
90
+ }
91
+
84
92
  _setComonFunctions(classObject, path) {
85
93
  classObject.prototype.getInstance = this._entityGetInstance(path);
86
94
  classObject.prototype.addListener = this._entityAddListener;
@@ -120,10 +128,11 @@ class ModulesInstancesController {
120
128
  params, noModes, modeName
121
129
  );
122
130
 
123
- self._addEntityToClass(instance, this);
124
-
125
- if (instance)
131
+ //no simpleClasses like ModulesAssetsBaseModel && ModulesObjectsBaseModel
132
+ if (instance && !instance.simpleClass) {
133
+ self._addEntityToClass(instance, this);
126
134
  self._setComonEntityFunctions(instance, this);
135
+ }
127
136
 
128
137
  return instance;
129
138
  };
@@ -1,5 +1,7 @@
1
1
  class ModulesObjectsBaseModel {
2
2
  constructor(params) {
3
+ this.simpleClass = true;
4
+
3
5
  this.setupParams(params);
4
6
 
5
7
  this.parent = false;