mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Makes singleton variable name of NotificationCenter lowercase
When we require a singleton, its instance name should be named by lowercase, since it is not a class. Relates to #128
This commit is contained in:
parent
ffc55a204a
commit
3cb2e39a18
57 changed files with 262 additions and 262 deletions
|
|
@ -9,7 +9,7 @@ define([
|
|||
"Lib/Utilities/Assert",
|
||||
],
|
||||
|
||||
function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) {
|
||||
function (PhysicsEngine, TiledLevel, Player, nc, Doll, GameObject, Item, Assert) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
@ -24,8 +24,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
this.physicsEngine.setCollisionDetector();
|
||||
|
||||
this.ncTokens = [
|
||||
Nc.on(Nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this),
|
||||
Nc.on(Nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this)
|
||||
nc.on(nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this),
|
||||
nc.on(nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this)
|
||||
];
|
||||
|
||||
this.loadLevel(options.levelUid);
|
||||
|
|
@ -116,10 +116,10 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
}
|
||||
|
||||
// FIXME ns.client in core?
|
||||
Nc.trigger(Nc.ns.client.game.events.destroy);
|
||||
nc.trigger(nc.ns.client.game.events.destroy);
|
||||
|
||||
// Testing after destroy if worldUpdateObjects is empty
|
||||
// events.game.destroy -> gameobjects.destroy() -> Nc.trigger(worldUpdateObjects.remove)
|
||||
// events.game.destroy -> gameobjects.destroy() -> nc.trigger(worldUpdateObjects.remove)
|
||||
if(Object.keys(this.worldUpdateObjects).length > 0) {
|
||||
console.warn('Not all worldUpdateObjects have been removed... ', Object.keys(this.worldUpdateObjects));
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
this.physicsEngine.destroy();
|
||||
this.worldUpdateObjects = null;
|
||||
|
||||
Nc.off(this.ncTokens);
|
||||
nc.off(this.ncTokens);
|
||||
};
|
||||
|
||||
return GameController;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue