patch Game.makeMove with id
This commit is contained in:
parent
e95315053c
commit
6742d54aff
1 changed files with 2 additions and 2 deletions
|
@ -262,7 +262,7 @@ const Game = ({ gameData = {}, gameRecord = [] } = {}) => {
|
||||||
return { ...this, success: false };
|
return { ...this, success: false };
|
||||||
},
|
},
|
||||||
|
|
||||||
makeMove: function ({ player, pos: { x, y }, id }) {
|
makeMove: function ({ player, pos: { x, y }, id, prior }) {
|
||||||
if (this.pass > 1) {
|
if (this.pass > 1) {
|
||||||
return { ...this, success: false };
|
return { ...this, success: false };
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ const Game = ({ gameData = {}, gameRecord = [] } = {}) => {
|
||||||
const point = game.boardState[`${x}-${y}`];
|
const point = game.boardState[`${x}-${y}`];
|
||||||
game.pass = 0;
|
game.pass = 0;
|
||||||
// allows for recording of prior move on game record
|
// allows for recording of prior move on game record
|
||||||
game.addToRecord({ player, pos: { x, y }, id });
|
game.addToRecord({ player, pos: { x, y }, id, prior });
|
||||||
if (game.kos.length) helper.clearKo.call(game);
|
if (game.kos.length) helper.clearKo.call(game);
|
||||||
point.makeMove(game);
|
point.makeMove(game);
|
||||||
game.turn *= -1;
|
game.turn *= -1;
|
||||||
|
|
Loading…
Reference in a new issue