diff options
author | Anthony Wang | 2021-05-09 15:42:24 -0500 |
---|---|---|
committer | Anthony Wang | 2021-05-09 15:42:24 -0500 |
commit | 203f24bd9c2dfae66bd6fded41f25ca59ee7223a (patch) | |
tree | e5524421b6e7744b167f848111ab175eef667689 | |
parent | 013018ecaefe1814eb3fb3ed366bf062220822ab (diff) |
Backend code cleanup
-rw-r--r-- | back/src/Game.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/back/src/Game.ts b/back/src/Game.ts index e7e69ac..d054fd7 100644 --- a/back/src/Game.ts +++ b/back/src/Game.ts @@ -60,7 +60,7 @@ export default class Game { const j = Math.floor(Math.random() * (i+1)); [cards[i], cards[j]] = [cards[j], cards[i]]; } - const handSize = 5; // 5 - this.room.clients.length/7; + const handSize = 5 - Math.floor(this.room.clients.length/7); for (let i = 0; i < this.room.clients.length; ++i) { this.players.push(new Player(this, this.room.clients[i])); this.players[i].cards = cards.slice(i * handSize, (i + 1) * handSize); @@ -92,8 +92,8 @@ export default class Game { } async round() { this.phase = 0; - this.players.forEach((p: Player) => { p.stack = []; }); - this.players.forEach((p: Player) => { p.flipped = []; }); + this.players.forEach((p: Player) => p.stack = []); + this.players.forEach((p: Player) => p.flipped = []); await this.prepare(); // Phase 0 this.phase = 1; this.lastPlayed = 0; |