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

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Nc) {
function (nc) {
function Input(playerController) {
this.playerController = playerController;

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
function (Parent, nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
"use strict";
@ -29,85 +29,85 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
PlayerController.prototype.moveLeft = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveLeft.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveLeft');
}
PlayerController.prototype.moveRight = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveRight.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveRight');
}
// always allow to stop, to prevent endless running
PlayerController.prototype.stop = function () {
Parent.prototype.stop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'stop');
}
PlayerController.prototype.jump = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.jump.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jump');
}
// always allow to stop.
PlayerController.prototype.jumpStop = function () {
Parent.prototype.jumpStop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jumpStop');
}
PlayerController.prototype.setXY = function(x, y) {
if (!this.isPlayerInputAllowed()) return;
var options = {x:x, y:y};
Parent.prototype.lookAt.call(this, options);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
};
PlayerController.prototype.suicide = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "suicide");
};
PlayerController.prototype.handActionRequest = function(options) {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
};
PlayerController.prototype.showInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, true);
nc.trigger(nc.ns.client.game.gameStats.toggle, true);
};
PlayerController.prototype.hideInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, false);
nc.trigger(nc.ns.client.game.gameStats.toggle, false);
};
PlayerController.prototype.zoomIn = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomIn, true);
nc.trigger(nc.ns.client.game.zoomIn, true);
};
PlayerController.prototype.zoomOut = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomOut, false);
nc.trigger(nc.ns.client.game.zoomOut, false);
};
PlayerController.prototype.zoomReset = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomReset, false);
nc.trigger(nc.ns.client.game.zoomReset, false);
};
PlayerController.prototype.activateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.activateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "activateModifier");
};
PlayerController.prototype.deactivateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.deactivateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
};
/*

View file

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Nc) {
function (nc) {
var MAX_LENGTH = 200;
var MIN_LENGTH = 5;
@ -42,7 +42,7 @@ function (Nc) {
}
var i = points.length - 1;
Nc.trigger(Nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
nc.trigger(nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
}
Swiper.prototype.updateLengthSum = function(currentLength) {
@ -135,7 +135,7 @@ function (Nc) {
var sumx = 0;
var sumy = 0;
Nc.trigger(Nc.ns.client.view.swiper.end);
nc.trigger(nc.ns.client.view.swiper.end);
for(var i=0, count = this.points.length; i < count; i++) {
var p = this.points[i];
@ -166,7 +166,7 @@ function (Nc) {
Swiper.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};