projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes + first draft of Chakart (just thoughts for now)
[vchess.git]
/
client
/
src
/
variants
/
Shogi.js
diff --git
a/client/src/variants/Shogi.js
b/client/src/variants/Shogi.js
index
082d939
..
50d273f
100644
(file)
--- a/
client/src/variants/Shogi.js
+++ b/
client/src/variants/Shogi.js
@@
-372,6
+372,18
@@
export class ShogiRules extends ChessRules {
);
}
);
}
+ getPotentialLanceMoves(sq) {
+ const forward = (this.turn == 'w' ? -1 : 1);
+ return this.getSlideNJumpMoves(
+ sq,
+ [[forward, 0]],
+ {
+ promote: V.P_LANCE,
+ force: true
+ }
+ );
+ }
+
getPotentialRookMoves(sq) {
return this.getSlideNJumpMoves(
sq, V.steps[V.ROOK], { promote: V.P_ROOK });
getPotentialRookMoves(sq) {
return this.getSlideNJumpMoves(
sq, V.steps[V.ROOK], { promote: V.P_ROOK });
@@
-382,12
+394,6
@@
export class ShogiRules extends ChessRules {
sq, V.steps[V.BISHOP], { promote: V.P_BISHOP });
}
sq, V.steps[V.BISHOP], { promote: V.P_BISHOP });
}
- getPotentialLanceMoves(sq) {
- const forward = (this.turn == 'w' ? -1 : 1);
- return this.getSlideNJumpMoves(
- sq, [[forward, 0]], { promote: V.P_LANCE });
- }
-
getPotentialDragonMoves(sq) {
return (
this.getSlideNJumpMoves(sq, V.steps[V.ROOK]).concat(
getPotentialDragonMoves(sq) {
return (
this.getSlideNJumpMoves(sq, V.steps[V.ROOK]).concat(