11
22var CameraManager = require ( '../plugins/CameraManager' ) ;
3+ var Class = require ( '../utils/Class' ) ;
34var Clock = require ( '../time/Clock' ) ;
4- // var Component = require('../components');
5- var EventDispatcher = require ( '../events/EventDispatcher' ) ;
6- var DisplayList = require ( '../plugins/DisplayList' ) ;
75var Data = require ( '../plugins/Data' ) ;
6+ var DisplayList = require ( '../plugins/DisplayList' ) ;
7+ var EventDispatcher = require ( '../events/EventDispatcher' ) ;
88var GameObjectCreator = require ( '../plugins/GameObjectCreator' ) ;
99var GameObjectFactory = require ( '../plugins/GameObjectFactory' ) ;
1010var Loader = require ( '../plugins/Loader' ) ;
@@ -13,47 +13,48 @@ var StableSort = require('../utils/array/StableSort');
1313var StateManager = require ( '../plugins/StateManager' ) ;
1414var TweenManager = require ( '../tween/TweenManager' ) ;
1515
16- var Systems = function ( state , config )
17- {
18- this . state = state ;
16+ var Systems = new Class ( {
1917
20- this . config = config ;
21- this . settings = Settings . create ( config ) ;
18+ initialize :
2219
23- this . sortChildrenFlag = false ;
20+ function Systems ( state , config )
21+ {
22+ this . state = state ;
23+
24+ this . config = config ;
25+ this . settings = Settings . create ( config ) ;
2426
25- // Set by the GlobalStateManager
26- this . mask = null ;
27- this . canvas ;
28- this . context ;
27+ this . sortChildrenFlag = false ;
2928
30- // CORE (GLOBAL) SYSTEMS / PROPERTIES
29+ // Set by the GlobalStateManager
30+ this . mask = null ;
31+ this . canvas ;
32+ this . context ;
3133
32- this . game ;
34+ // CORE (GLOBAL) SYSTEMS / PROPERTIES
3335
34- this . anims ;
35- this . cache ;
36- this . input ;
37- this . registry ;
38- this . textures ;
36+ this . game ;
3937
40- // Reference to State specific managers (Factory, Tweens, Loader, Physics, etc)
41- this . add ;
42- this . cameras ;
43- this . events ;
44- this . load ;
45- this . make ;
46- this . stateManager ;
47- this . time ;
48- this . tweens ;
38+ this . anims ;
39+ this . cache ;
40+ this . input ;
41+ this . registry ;
42+ this . textures ;
4943
50- // State properties
51- this . children ;
52- this . color ;
53- this . data ;
54- } ;
44+ // Reference to State specific managers (Factory, Tweens, Loader, Physics, etc)
45+ this . add ;
46+ this . cameras ;
47+ this . events ;
48+ this . load ;
49+ this . make ;
50+ this . stateManager ;
51+ this . time ;
52+ this . tweens ;
5553
56- Systems . prototype = {
54+ // State properties
55+ this . children ;
56+ this . data ;
57+ } ,
5758
5859 init : function ( game )
5960 {
@@ -72,7 +73,6 @@ Systems.prototype = {
7273 // State specific properties (transform, data, children, etc)
7374
7475 this . children = new DisplayList ( state ) ;
75- // this.color = new Component.Color(state);
7676 this . data = new Data ( state ) ;
7777
7878 // State specific managers (Factory, Tweens, Loader, Physics, etc)
@@ -256,8 +256,7 @@ Systems.prototype = {
256256 this . state . destroy . call ( this . state ) ;
257257 }
258258 }
259- } ;
260259
261- Systems . prototype . constructor = Systems ;
260+ } ) ;
262261
263262module . exports = Systems ;
0 commit comments