diff --git a/lib/server/controllers/entitycontroller.js b/lib/server/controllers/entitycontroller.js new file mode 100644 index 0000000..9789b4f --- /dev/null +++ b/lib/server/controllers/entitycontroller.js @@ -0,0 +1,7 @@ +exports = module.exports = EntityController; + +function EntityController () { +} + +EntityController.prototype = { +}; \ No newline at end of file diff --git a/lib/server/controllers/playercontroller.js b/lib/server/controllers/playercontroller.js new file mode 100644 index 0000000..d489a7d --- /dev/null +++ b/lib/server/controllers/playercontroller.js @@ -0,0 +1,10 @@ +var EntityController = require('./entitycontroller'), + Player = require('../entities/player'); + +exports = module.exports = PlayerController; + +function PlayerController () { + EntityController.call(this); +} + +PlayerController.prototype = Object.create(EntityController.prototype); \ No newline at end of file diff --git a/lib/server/entities/entity.js b/lib/server/entities/entity.js new file mode 100644 index 0000000..bcbf091 --- /dev/null +++ b/lib/server/entities/entity.js @@ -0,0 +1,8 @@ +exports = module.exports = Entity; + +function Entity () { +} + +Entity.prototype = { + +}; \ No newline at end of file diff --git a/lib/server/entities/player.js b/lib/server/entities/player.js new file mode 100644 index 0000000..86abd6c --- /dev/null +++ b/lib/server/entities/player.js @@ -0,0 +1,9 @@ +var Entity = require('./entity'); + +exports = module.exports = Player; + +function Player () { + Entity.call(this); +} + +Player.prototype = Object.create(Entity.prototype); \ No newline at end of file diff --git a/lib/server/garageserver.io.js b/lib/server/garageserver.io.js index 77a0e9c..b17600b 100644 --- a/lib/server/garageserver.io.js +++ b/lib/server/garageserver.io.js @@ -1,4 +1,4 @@ -var garageServerGame = require('./garageservergame'); +var GarageServerGame = require('./garageservergame'); /* options = { @@ -20,7 +20,7 @@ options = { function GarageServer (socketio, options) { this.io = socketio; - this.game = new garageServerGame.createGame(options); + this.game = new GarageServerGame(options); this.registerSocketEvents(options); } diff --git a/lib/server/garageservergame.js b/lib/server/garageservergame.js index 4f0242f..b7c8b32 100644 --- a/lib/server/garageservergame.js +++ b/lib/server/garageservergame.js @@ -1,3 +1,7 @@ +var PlayerController = require('./controllers/playercontroller'); + +exports = module.exports = GarageServerGame; + function GarageServerGame(options) { var self = this; @@ -100,8 +104,4 @@ GarageServerGame.prototype.addPlayerInput = function (client, input) { return true; } }); -}; - -exports.createGame = function (options){ - return new GarageServerGame(options); }; \ No newline at end of file