From 08869d878e461750bf6756e9657919585a2ef959 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Sat, 13 Jul 2013 22:11:45 -0400 Subject: [PATCH] Progress of #3 --- lib/server/garageserver.io.js | 4 ++++ lib/server/garageservergame.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/server/garageserver.io.js b/lib/server/garageserver.io.js index 9856de7..7bad2dc 100644 --- a/lib/server/garageserver.io.js +++ b/lib/server/garageserver.io.js @@ -125,15 +125,19 @@ GarageServer.prototype.updatePlayerState = function (id, state) { }; GarageServer.prototype.addEntity = function (id) { + this.game.addEntity(id); }; GarageServer.prototype.removeEntity = function (id) { + this.game.removeEntity(id); }; GarageServer.prototype.updateEntityState = function (id, state) { + }; GarageServer.prototype.getEntities = function () { + return this.game.getEntities(); }; exports.createGarageServer = function (io, options) { diff --git a/lib/server/garageservergame.js b/lib/server/garageservergame.js index abf5fc3..b6722cf 100644 --- a/lib/server/garageservergame.js +++ b/lib/server/garageservergame.js @@ -47,6 +47,10 @@ GarageServerGame.prototype.getPlayers = function () { return this.playerController.entities; }; +GarageServerGame.prototype.getEntities = function () { + return this.entityController.entities; +}; + GarageServerGame.prototype.getPlayer = function (id) { var playerFound; @@ -80,6 +84,14 @@ GarageServerGame.prototype.removePlayer = function (id) { this.playerController.remove(id); }; +GarageServerGame.prototype.addEntity = function (id) { + this.entityController.add(id); +}; + +GarageServerGame.prototype.removeEntity = function (id) { + this.entityController.remove(id); +}; + GarageServerGame.prototype.setPlayerState = function (id, state) { this.playerController.setState(id, state); };