diff options
-rw-r--r-- | draughts/app.js | 2 | ||||
-rw-r--r-- | draughts/game.js | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/draughts/app.js b/draughts/app.js index fc0b273..ba1d957 100644 --- a/draughts/app.js +++ b/draughts/app.js @@ -37,7 +37,7 @@ wss.on("connection", ws => { */ let game = env.games.filter(g => !g.ongoing)[0] if (!game) { - game = new Game(env.games.length) /* The number of games servers as a unique game ID */ + game = new Game() env.games.push(game) game.bluePlayer = ws game.messageClient({ head: Messages.WELCOME, body: Color.BLUE }, ws) diff --git a/draughts/game.js b/draughts/game.js index 067cb9a..107cd3d 100644 --- a/draughts/game.js +++ b/draughts/game.js @@ -197,7 +197,6 @@ const calculateMoves = (p, board) => { /* * Signature: - * this.id :: Number * this.board :: Piece[][] * this.ongoing :: Boolean * this.bluePlayer :: WebSocket @@ -209,8 +208,7 @@ const calculateMoves = (p, board) => { * A class representing a game. It contains the current game state as well as the complete move * history and the websockets of both players. */ -const Game = function(gameID) { - this.id = gameID +const Game = function() { this.board = boardInit() this.ongoing = false this.bluePlayer = null |