Cleanup/refactor for #3

This commit is contained in:
Jeremiah Billmann
2013-07-06 00:32:48 -04:00
parent e321124aa0
commit 6da3628ad4
6 changed files with 40 additions and 6 deletions
@@ -0,0 +1,7 @@
exports = module.exports = EntityController;
function EntityController () {
}
EntityController.prototype = {
};
@@ -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);
+8
View File
@@ -0,0 +1,8 @@
exports = module.exports = Entity;
function Entity () {
}
Entity.prototype = {
};
+9
View File
@@ -0,0 +1,9 @@
var Entity = require('./entity');
exports = module.exports = Player;
function Player () {
Entity.call(this);
}
Player.prototype = Object.create(Entity.prototype);
+2 -2
View File
@@ -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);
}
+4 -4
View File
@@ -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);
};