Skip to content

Commit 5a333bc

Browse files
committed
Updated to new Plugin format, removed injection and mapping
1 parent e017a71 commit 5a333bc

13 files changed

Lines changed: 15 additions & 67 deletions

File tree

src/cameras/2d/CameraManager.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ var CameraManager = new Class({
1717

1818
this.systems = scene.sys;
1919

20-
this.mapping = 'cameras';
21-
2220
this.systems.events.on('boot', this.boot, this);
2321

2422
this.currentCameraId = 1;
@@ -43,8 +41,6 @@ var CameraManager = new Class({
4341

4442
boot: function ()
4543
{
46-
this.systems.inject(this);
47-
4844
this.systems.events.on('update', this.update, this);
4945
this.systems.events.on('shutdown', this.shutdown, this);
5046
this.systems.events.on('destroy', this.destroy, this);
@@ -302,6 +298,6 @@ var CameraManager = new Class({
302298

303299
});
304300

305-
PluginManager.register('cameras', CameraManager);
301+
PluginManager.register('CameraManager', CameraManager, 'cameras');
306302

307303
module.exports = CameraManager;

src/cameras/sprite3d/CameraManager.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ var CameraManager = new Class({
1717

1818
this.systems = scene.sys;
1919

20-
this.mapping = 'cameras';
21-
2220
this.systems.events.on('boot', this.boot, this);
2321
},
2422

2523
boot: function ()
2624
{
27-
this.systems.inject(this);
28-
2925
this.systems.events.on('update', this.update, this);
3026
this.systems.events.on('shutdown', this.shutdown, this);
3127
this.systems.events.on('destroy', this.destroy, this);
@@ -135,6 +131,6 @@ var CameraManager = new Class({
135131

136132
});
137133

138-
// PluginManager.register('cameras', CameraManager);
134+
PluginManager.register('CameraManager3D', CameraManager, 'cameras3d');
139135

140136
module.exports = CameraManager;

src/gameobjects/DisplayList.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ var DisplayList = new Class({
1313

1414
this.systems = scene.sys;
1515

16-
this.mapping = 'children';
17-
1816
this.systems.events.on('boot', this.boot, this);
1917

2018
// The objects that belong to this collection.
@@ -28,8 +26,6 @@ var DisplayList = new Class({
2826

2927
boot: function ()
3028
{
31-
this.systems.inject(this);
32-
3329
this.systems.events.on('shutdown', this.shutdown, this);
3430
this.systems.events.on('destroy', this.destroy, this);
3531
},
@@ -724,6 +720,6 @@ var DisplayList = new Class({
724720

725721
});
726722

727-
PluginManager.register('displayList', DisplayList);
723+
PluginManager.register('DisplayList', DisplayList, 'displayList');
728724

729725
module.exports = DisplayList;

src/gameobjects/GameObjectCreator.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ var GameObjectCreator = new Class({
1212

1313
this.systems = scene.sys;
1414

15-
this.mapping = 'make';
16-
1715
this.systems.events.on('boot', this.boot, this);
1816

1917
this.displayList;
@@ -22,8 +20,6 @@ var GameObjectCreator = new Class({
2220

2321
boot: function ()
2422
{
25-
this.systems.inject(this);
26-
2723
this.displayList = this.systems.displayList;
2824
this.updateList = this.systems.updateList;
2925

@@ -33,7 +29,7 @@ var GameObjectCreator = new Class({
3329

3430
shutdown: function ()
3531
{
36-
32+
// TODO
3733
},
3834

3935
destroy: function ()
@@ -55,6 +51,6 @@ GameObjectCreator.register = function (type, factoryFunction)
5551
}
5652
};
5753

58-
PluginManager.register('make', GameObjectCreator);
54+
PluginManager.register('GameObjectCreator', GameObjectCreator, 'make');
5955

6056
module.exports = GameObjectCreator;

src/gameobjects/GameObjectFactory.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ var GameObjectFactory = new Class({
1212

1313
this.systems = scene.sys;
1414

15-
this.mapping = 'add';
16-
1715
this.systems.events.on('boot', this.boot, this);
1816

1917
this.displayList;
@@ -22,8 +20,6 @@ var GameObjectFactory = new Class({
2220

2321
boot: function ()
2422
{
25-
this.systems.inject(this);
26-
2723
this.displayList = this.systems.displayList;
2824
this.updateList = this.systems.updateList;
2925

@@ -48,7 +44,7 @@ var GameObjectFactory = new Class({
4844

4945
shutdown: function ()
5046
{
51-
47+
// TODO
5248
},
5349

5450
destroy: function ()
@@ -70,6 +66,6 @@ GameObjectFactory.register = function (type, factoryFunction)
7066
}
7167
};
7268

73-
PluginManager.register('add', GameObjectFactory);
69+
PluginManager.register('GameObjectFactory', GameObjectFactory, 'add');
7470

7571
module.exports = GameObjectFactory;

src/gameobjects/UpdateList.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ var UpdateList = new Class({
1111

1212
this.systems = scene.sys;
1313

14-
this.mapping = null;
15-
1614
this.systems.events.on('boot', this.boot, this);
1715

1816
this._list = [];
@@ -22,8 +20,6 @@ var UpdateList = new Class({
2220

2321
boot: function ()
2422
{
25-
this.systems.inject(this);
26-
2723
this.systems.events.on('preupdate', this.preUpdate, this);
2824
this.systems.events.on('update', this.update, this);
2925
this.systems.events.on('shutdown', this.shutdown, this);
@@ -135,6 +131,6 @@ var UpdateList = new Class({
135131

136132
});
137133

138-
PluginManager.register('updateList', UpdateList);
134+
PluginManager.register('UpdateList', UpdateList, 'updateList');
139135

140136
module.exports = UpdateList;

src/input/InputPlugin.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ var InputPlugin = new Class({
3232

3333
this.systems = scene.sys;
3434

35-
this.mapping = 'input';
36-
3735
this.systems.events.on('boot', this.boot, this);
3836

3937
// InputManager
@@ -96,8 +94,6 @@ var InputPlugin = new Class({
9694

9795
boot: function ()
9896
{
99-
this.systems.inject(this);
100-
10197
this.systems.events.on('preupdate', this.preUpdate, this);
10298
this.systems.events.on('update', this.update, this);
10399
this.systems.events.on('shutdown', this.shutdown, this);
@@ -1006,6 +1002,6 @@ var InputPlugin = new Class({
10061002

10071003
});
10081004

1009-
PluginManager.register('input', InputPlugin);
1005+
PluginManager.register('InputPlugin', InputPlugin, 'input');
10101006

10111007
module.exports = InputPlugin;

src/loader/Loader.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ var Loader = new Class({
3737

3838
this.systems = scene.sys;
3939

40-
this.mapping = 'load';
41-
4240
this.systems.events.on('boot', this.boot, this);
4341

4442
this._multilist = {};
4543
},
4644

4745
boot: function ()
4846
{
49-
this.systems.inject(this);
50-
5147
this.systems.events.on('shutdown', this.shutdown, this);
5248
this.systems.events.on('destroy', this.destroy, this);
5349
},
@@ -325,6 +321,6 @@ var Loader = new Class({
325321

326322
});
327323

328-
PluginManager.register('load', Loader);
324+
PluginManager.register('Loader', Loader, 'load');
329325

330326
module.exports = Loader;

src/physics/arcade/ArcadePhysics.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ var ArcadePhysics = new Class({
1818

1919
this.systems = scene.sys;
2020

21-
this.mapping = 'physics';
22-
2321
this.systems.events.on('boot', this.boot, this);
2422

2523
this.config = this.getConfig();
@@ -47,8 +45,6 @@ var ArcadePhysics = new Class({
4745
this.world = new World(this.scene, this.config);
4846
this.add = new Factory(this.world);
4947

50-
this.systems.inject(this);
51-
5248
this.systems.events.on('update', this.world.update, this.world);
5349
this.systems.events.on('postupdate', this.world.postUpdate, this.world);
5450
this.systems.events.on('shutdown', this.shutdown, this);
@@ -95,6 +91,6 @@ var ArcadePhysics = new Class({
9591

9692
});
9793

98-
PluginManager.register('arcadePhysics', ArcadePhysics);
94+
PluginManager.register('ArcadePhysics', ArcadePhysics, 'arcadePhysics');
9995

10096
module.exports = ArcadePhysics;

src/physics/impact/ImpactPhysics.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ var ImpactPhysics = new Class({
1818

1919
this.systems = scene.sys;
2020

21-
this.mapping = 'impact';
22-
2321
this.systems.events.on('boot', this.boot, this);
2422

2523
this.config = this.getConfig();
@@ -47,8 +45,6 @@ var ImpactPhysics = new Class({
4745
this.world = new World(this.scene, this.config);
4846
this.add = new Factory(this.world);
4947

50-
this.systems.inject(this);
51-
5248
this.systems.events.on('update', this.world.update, this.world);
5349
this.systems.events.on('shutdown', this.shutdown, this);
5450
this.systems.events.on('destroy', this.destroy, this);
@@ -66,6 +62,6 @@ var ImpactPhysics = new Class({
6662

6763
});
6864

69-
PluginManager.register('impactPhysics', ImpactPhysics);
65+
PluginManager.register('ImpactPhysics', ImpactPhysics, 'impactPhysics');
7066

7167
module.exports = ImpactPhysics;

0 commit comments

Comments
 (0)