Makes singleton variable name of OptionsHelper 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 23:11:18 +02:00
parent 05c4e4de81
commit 5b3bfd4370
6 changed files with 13 additions and 13 deletions

View file

@ -7,7 +7,7 @@
"Game/Config/Settings" "Game/Config/Settings"
], ],
function (GameController, nc, User, ProtocolHelper, OptionsHelper, Settings) { function (GameController, nc, User, ProtocolHelper, optionsHelper, Settings) {
"use strict"; "use strict";
@ -21,7 +21,7 @@
this.levelListIndex = -1; this.levelListIndex = -1;
this.gameController = null; this.gameController = null;
this.options = options = OptionsHelper.merge(options, { this.options = options = optionsHelper.merge(options, {
levelUids: Settings.CHANNEL_DEFAULT_LEVELS levelUids: Settings.CHANNEL_DEFAULT_LEVELS
}); });

View file

@ -8,7 +8,7 @@ define([
"Lib/Utilities/Assert" "Lib/Utilities/Assert"
], ],
function (Parent, Box2D, OptionsHelper, Settings, Exception, nc, Assert) { function (Parent, Box2D, optionsHelper, Settings, Exception, nc, Assert) {
"use strict"; "use strict";
@ -26,7 +26,7 @@ function (Parent, Box2D, OptionsHelper, Settings, Exception, nc, Assert) {
y: parseFloat(options.y) y: parseFloat(options.y)
}; };
this.options = OptionsHelper.merge(floatOptions, options); this.options = optionsHelper.merge(floatOptions, options);
if(!this.options.category) { if(!this.options.category) {
// FIXME add more validation // FIXME add more validation

View file

@ -8,7 +8,7 @@ define([
"Game/Config/ItemSettings", "Game/Config/ItemSettings",
], ],
function (Parent, Box2D, Settings, nc, Assert, OptionsHelper, ItemSettings) { function (Parent, Box2D, Settings, nc, Assert, optionsHelper, ItemSettings) {
"use strict"; "use strict";
@ -96,8 +96,8 @@ function (Parent, Box2D, Settings, nc, Assert, OptionsHelper, ItemSettings) {
// FIXME // FIXME
var ragdollOptions = OptionsHelper.merge(ItemSettings.RagDoll, ItemSettings.Default); var ragdollOptions = optionsHelper.merge(ItemSettings.RagDoll, ItemSettings.Default);
options = OptionsHelper.merge(options, ragdollOptions); options = optionsHelper.merge(options, ragdollOptions);
Parent.call(this, physicsEngine, uid, options); Parent.call(this, physicsEngine, uid, options);
//this.createSensor(); //this.createSensor();

View file

@ -13,7 +13,7 @@ define([
"Game/" + GLOBALS.context + "/GameObjects/Item", "Game/" + GLOBALS.context + "/GameObjects/Item",
"Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard", "Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard",
], function (Parent, Settings, ItemSettings, Box2D, OptionsHelper, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) { ], function (Parent, Settings, ItemSettings, Box2D, optionsHelper, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) {
"use strict"; "use strict";
@ -187,7 +187,7 @@ define([
throw new Exception("Item name (" + name + ") cannot be found in item list"); throw new Exception("Item name (" + name + ") cannot be found in item list");
} }
return OptionsHelper.merge(ItemSettings[name], ItemSettings.Default); return optionsHelper.merge(ItemSettings[name], ItemSettings.Default);
}; };
TiledLevel.prototype.getTileImagePath = function(gid) { TiledLevel.prototype.getTileImagePath = function(gid) {

View file

@ -10,7 +10,7 @@ function (Exception) {
} }
OptionsHelper.prototype.merge = function(options, preset) { optionsHelper.prototype.merge = function(options, preset) {
if(!preset && !options) { if(!preset && !options) {
throw new Exception("OptionsHelper requires objects"); throw new Exception("OptionsHelper requires objects");
@ -43,7 +43,7 @@ function (Exception) {
if(options[key].constructor !== Object) { if(options[key].constructor !== Object) {
preset[key] = options[key]; preset[key] = options[key];
} else { } else {
preset[key] = OptionsHelper.prototype.merge.call(this, options[key], preset[key]); preset[key] = optionsHelper.prototype.merge.call(this, options[key], preset[key]);
} }
} }
} }

View file

@ -7,7 +7,7 @@ define([
"fs" "fs"
], ],
function (nc, ProtocolHelper, validate, OptionsHelper, Settings, FileSystem) { function (nc, ProtocolHelper, validate, optionsHelper, Settings, FileSystem) {
"use strict"; "use strict";
@ -121,7 +121,7 @@ function (nc, ProtocolHelper, validate, OptionsHelper, Settings, FileSystem) {
scoreLimit: Settings.CHANNEL_DEFAULT_SCORE_LIMIT scoreLimit: Settings.CHANNEL_DEFAULT_SCORE_LIMIT
}; };
options = OptionsHelper.merge(options, defaultOptions); options = optionsHelper.merge(options, defaultOptions);
var result = this.coordinator.createChannel(options); var result = this.coordinator.createChannel(options);
if(result !== false) { if(result !== false) {