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:
logsol 2016-10-10 22:11:55 +02:00
parent ffc55a204a
commit 3cb2e39a18
57 changed files with 262 additions and 262 deletions

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, Nc) {
function (Abstract, nc) {
"use strict";
@ -59,7 +59,7 @@ function (Abstract, Nc) {
Layer.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, domController, Settings, Exception, Nc) {
function (Abstract, domController, Settings, Exception, nc) {
"use strict";
@ -16,14 +16,14 @@ function (Abstract, domController, Settings, Exception, Nc) {
this.debugMode = false;
this.ncTokens = [
Nc.on(Nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
nc.on(nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
Nc.on(Nc.ns.client.game.zoomIn, this.onZoomIn, this),
Nc.on(Nc.ns.client.game.zoomOut, this.onZoomOut, this),
Nc.on(Nc.ns.client.game.zoomReset, this.onZoomReset, this),
nc.on(nc.ns.client.game.zoomIn, this.onZoomIn, this),
nc.on(nc.ns.client.game.zoomOut, this.onZoomOut, this),
nc.on(nc.ns.client.game.zoomReset, this.onZoomReset, this),
Nc.on(Nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
nc.on(nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
];
}
@ -98,7 +98,7 @@ function (Abstract, domController, Settings, Exception, Nc) {
AbstractView.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
function (Settings, nc, Screenfull, Graph, PointerLockManager) {
"use strict";
@ -122,7 +122,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.onclick = function(e) {
Nc.trigger(Nc.ns.client.view.debugMode.toggle, e.target.checked);
nc.trigger(nc.ns.client.view.debugMode.toggle, e.target.checked);
};
label.appendChild(checkbox);
label.appendChild(document.createTextNode("Debug"));
@ -147,7 +147,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
// FIXME : isn't this a weird place for this?
window.onresize = function() {
Nc.trigger(Nc.ns.client.view.display.change);
nc.trigger(nc.ns.client.view.display.change);
};
};
@ -180,7 +180,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
};
DomController.prototype.initCanvas = function (canvas) {
Nc.trigger(Nc.ns.client.view.display.change, Screenfull.isFullscreen);
nc.trigger(nc.ns.client.view.display.change, Screenfull.isFullscreen);
};
DomController.prototype.setConnected = function(connected) {

View file

@ -4,7 +4,7 @@ define([
"Game/Client/View/Pixi/Layer"
],
function (Nc, Exception, Layer) {
function (nc, Exception, Layer) {
"use strict";
@ -13,16 +13,16 @@ function (Nc, Exception, Layer) {
this.container = container;
this.ncTokens = [
Nc.on(Nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
Nc.on(Nc.ns.client.view.mesh.create, this.createMesh, this),
Nc.on(Nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
Nc.on(Nc.ns.client.view.mesh.add, this.addMesh, this),
Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this),
Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this),
Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this),
Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
nc.on(nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
nc.on(nc.ns.client.view.mesh.create, this.createMesh, this),
nc.on(nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
nc.on(nc.ns.client.view.mesh.add, this.addMesh, this),
nc.on(nc.ns.client.view.mesh.remove, this.removeMesh, this),
nc.on(nc.ns.client.view.mesh.update, this.updateMesh, this),
nc.on(nc.ns.client.view.mesh.addFilter, this.addFilter, this),
nc.on(nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
nc.on(nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
nc.on(nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
];
}
@ -171,7 +171,7 @@ function (Nc, Exception, Layer) {
LayerManager.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
for (var i = this.layers.length - 1; i >= 0; i--) {
var layer = this.layers[i];

View file

@ -5,7 +5,7 @@ define([
"Lib/Vendor/Screenfull"
],
function (Settings, Nc, Stats, Screenfull) {
function (Settings, nc, Stats, Screenfull) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/ColorConverter"
],
function (PIXI, Nc, Settings, ColorConverter) {
function (PIXI, nc, Settings, ColorConverter) {
"use strict";
@ -63,8 +63,8 @@ function (PIXI, Nc, Settings, ColorConverter) {
this.sortedPlayers = [];
this.ncTokens = [
Nc.on(Nc.ns.client.view.gameStats.toggle, this.toggle, this),
Nc.on(Nc.ns.client.view.gameStats.update, this.update, this)
nc.on(nc.ns.client.view.gameStats.toggle, this.toggle, this),
nc.on(nc.ns.client.view.gameStats.update, this.update, this)
];
}
@ -197,7 +197,7 @@ function (PIXI, Nc, Settings, ColorConverter) {
GameStats.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, nc) {
"use strict";
@ -23,7 +23,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
}
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
]);
if (Settings.SHOW_LAYER_INFO) {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,12 +13,12 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "ghost", {parallaxSpeed: 0});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
Nc.on(Nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
Nc.on(Nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
Nc.on(Nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
nc.on(nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
nc.on(nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
nc.on(nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
nc.on(nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
nc.on(nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
]);
}

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,7 +13,7 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "messages", {parallaxSpeed:-1});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.gameStats.kill, this.onKill, this)
nc.on(nc.ns.client.view.gameStats.kill, this.onKill, this)
]);
this.mainTextOptions = {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
function Swiper() {
Parent.call(this, "swiper", {parallaxSpeed:0});
@ -13,8 +13,8 @@ function (Parent, PIXI, Nc, Settings) {
this.static = true;
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this),
Nc.on(Nc.ns.client.view.swiper.end, this.end, this)
nc.on(nc.ns.client.view.swiper.swipe, this.swipe, this),
nc.on(nc.ns.client.view.swiper.end, this.end, this)
]);
this.sprite = new PIXI.Graphics();

View file

@ -14,7 +14,7 @@ define([
"Game/Client/View/Pixi/Layers/Messages"
],
function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
"use strict";
@ -35,8 +35,8 @@ function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, Layer
this.init();
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
Nc.on(Nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
nc.on(nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
nc.on(nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
]);
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Settings, Exception, AbstractView, PixiView, Nc) {
function (Settings, Exception, AbstractView, PixiView, nc) {
"use strict";