-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameproxy.js
More file actions
25 lines (22 loc) · 724 Bytes
/
gameproxy.js
File metadata and controls
25 lines (22 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*jshint esversion: 6 */
class GameProxy {
constructor(game) {
this.gameID = game.gameID;
this.name = game.name;
this.gameEnded = game.gameEnded;
this.gameStarted = game.gameStarted;
this.gameSize = game.gameSize;
this.colunas= game.colunas;
this.players = game.players;
this.playerTurn = game.playerTurn;;
this.winner = game.winner;
this.board = [];
for(let i =0; i<game.board.length; i++){
this.board[i] = game.board[i].show ? game.board[i].piece : game.hidden;
}
this.created = game.created;
this.lastPlay=game.lastPlay;
this.hasBot=game.hasBot;
}
}
module.exports = GameProxy;