context awarenes in Core

This commit is contained in:
Jeena 2013-12-09 17:35:29 +01:00
parent b82b02d4ab
commit c1a4f16cc4
14 changed files with 50 additions and 14 deletions

View file

@ -1,9 +1,8 @@
define([ define([
"Game/Core/Collision/Detector", "Game/Core/Collision/Detector"
"Lib/Vendor/Box2D"
], ],
function (Parent, Box2D) { function (Parent) {
function Detector (player) { function Detector (player) {
Parent.call(this, player); Parent.call(this, player);
@ -11,5 +10,8 @@ function (Parent, Box2D) {
Detector.prototype = Object.create(Parent.prototype); Detector.prototype = Object.create(Parent.prototype);
Detector.IDENTIFIER = Parent.IDENTIFIER; // Needed because otherwise it will not be
// inherited because it is not in prototype
return Detector; return Detector;
}); });

View file

@ -0,0 +1,9 @@
define([
"Game/Core/Loader/Level"
],
function(Parent) {
return Parent;
});

View file

@ -0,0 +1,9 @@
define([
"Game/Core/Physics/Doll"
],
function(Parent) {
return Parent;
});

View file

@ -0,0 +1,9 @@
define([
"Game/Core/Player"
],
function(Parent) {
return Parent;
});

View file

@ -1,7 +1,7 @@
define([ define([
"Game/Core/Physics/Engine", "Game/" + GLOBALS.context + "/Physics/Engine",
"Game/Core/Loader/Level", "Game/" + GLOBALS.context + "/Loader/Level",
"Game/Core/Player" "Game/" + GLOBALS.context + "/Player"
], ],
function (Engine, Level, Player) { function (Engine, Level, Player) {

View file

@ -1,7 +1,8 @@
define([ define([
"Game/Config/Settings", "Game/Config/Settings",
"Lib/Vendor/Box2D", "Lib/Vendor/Box2D",
"Game/Core/Collision/Detector" "Game/" + GLOBALS.context + "/Collision/Detector"
], function (Settings, Box2D, CollisionDetector) { ], function (Settings, Box2D, CollisionDetector) {
// Public // Public

View file

@ -1,7 +1,7 @@
define([ define([
"Lib/Vendor/Box2D", "Lib/Vendor/Box2D",
"Game/Config/Settings", "Game/Config/Settings",
"Game/Core/Collision/Detector" "Game/" + GLOBALS.context + "/Collision/Detector"
], ],
function (Box2D, Settings, CollisionDetector) { function (Box2D, Settings, CollisionDetector) {

View file

@ -1,7 +1,7 @@
define([ define([
"Game/Config/Settings", "Game/Config/Settings",
"Lib/Vendor/Box2D", "Lib/Vendor/Box2D",
"Game/Core/Collision/Detector" "Game/" + GLOBALS.context + "/Collision/Detector"
], ],
function (Settings, Box2D, CollisionDetector) { function (Settings, Box2D, CollisionDetector) {

View file

@ -1,5 +1,5 @@
define([ define([
"Game/Core/Physics/Doll", "Game/" + GLOBALS.context + "/Physics/Doll",
"Game/Config/Settings" "Game/Config/Settings"
], ],

View file

@ -1,9 +1,8 @@
define([ define([
"Game/Core/Collision/Detector", "Game/Core/Collision/Detector"
"Lib/Vendor/Box2D"
], ],
function (Parent, Box2D) { function (Parent) {
function Detector (player) { function Detector (player) {
Parent.call(this, player); Parent.call(this, player);
@ -11,5 +10,8 @@ function (Parent, Box2D) {
Detector.prototype = Object.create(Parent.prototype); Detector.prototype = Object.create(Parent.prototype);
Detector.IDENTIFIER = Parent.IDENTIFIER; // Needed because otherwise it will not be
// inherited because it is not in prototype
return Detector; return Detector;
}); });

View file

@ -1,5 +1,5 @@
define([ define([
"Game/Core/Level" "Game/Core/Loader/Level"
], ],
function(Parent) { function(Parent) {

View file

@ -1,3 +1,4 @@
GLOBALS = { context: "Server" };
var requirejs = require('requirejs'); var requirejs = require('requirejs');
requirejs.config({ requirejs.config({

View file

@ -1,3 +1,5 @@
GLOBALS = { context: "Client" };
requirejs.config({ requirejs.config({
baseUrl: 'app', baseUrl: 'app',
deps: ['Lib/Utilities/Extensions'] deps: ['Lib/Utilities/Extensions']

View file

@ -1,3 +1,4 @@
GLOBALS = { context: "Server" };
var requirejs = require('requirejs'); var requirejs = require('requirejs');
var inspector; var inspector;