Reversi (#6765)
* wip * wip * wip * wip * Update game.setting.vue * wip * wip * Update game.setting.vue * wip * Update game.board.vue * wip * Update sidebar.ts
This commit is contained in:
parent
6f34c74027
commit
6258ce75b7
18 changed files with 1286 additions and 66 deletions
|
@ -243,20 +243,23 @@ export default class extends Channel {
|
|||
if (game.isEnded) return;
|
||||
if ((game.user1Id !== this.user.id) && (game.user2Id !== this.user.id)) return;
|
||||
|
||||
const myColor =
|
||||
((game.user1Id === this.user.id) && game.black == 1) || ((game.user2Id === this.user.id) && game.black == 2)
|
||||
? true
|
||||
: false;
|
||||
|
||||
const o = new Reversi(game.map, {
|
||||
isLlotheo: game.isLlotheo,
|
||||
canPutEverywhere: game.canPutEverywhere,
|
||||
loopedBoard: game.loopedBoard
|
||||
});
|
||||
|
||||
// 盤面の状態を再生
|
||||
for (const log of game.logs) {
|
||||
o.put(log.color, log.pos);
|
||||
}
|
||||
|
||||
const myColor =
|
||||
((game.user1Id === this.user.id) && game.black == 1) || ((game.user2Id === this.user.id) && game.black == 2)
|
||||
? true
|
||||
: false;
|
||||
if (o.turn !== myColor) return;
|
||||
|
||||
if (!o.canPut(myColor, pos)) return;
|
||||
o.put(myColor, pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue