修改队伍的设置方式

This commit is contained in:
zhl 2020-12-25 18:10:41 +08:00
parent 19d6d2b741
commit f038fba3cb

View File

@ -12,7 +12,7 @@ export class OnJoinCommand extends Command<CardGameState, {
client: Client
}> {
execute({client} = this.payload) {
let team = this.state.players.size / 2 | 0;
let team = (this.state.players.size == 1 || this.state.players.size == 2)? 1 : 0;
// 实际的team会在PlayReadyCommand中设置
let player = new Player(client.sessionId, 0, team);
this.state.players.set(client.sessionId, player);