Backend code cleanup
This commit is contained in:
parent
013018ecae
commit
203f24bd9c
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue