- // Apply a move on board
- static PlayOnBoard(board, move)
- {
- for (let psq of move.vanish)
- board[psq.x][psq.y] = VariantRules.EMPTY;
- for (let psq of move.appear)
- board[psq.x][psq.y] = psq.c + psq.p;
- }
- // Un-apply the played move
- static UndoOnBoard(board, move)
- {
- for (let psq of move.appear)
- board[psq.x][psq.y] = VariantRules.EMPTY;
- for (let psq of move.vanish)
- board[psq.x][psq.y] = psq.c + psq.p;
- }
-
- // TODO: need antikingPos as well