projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generalize pawn movements: cleaner and smaller code
[vchess.git]
/
client
/
src
/
variants
/
Royalrace.js
diff --git
a/client/src/variants/Royalrace.js
b/client/src/variants/Royalrace.js
index
346ca5f
..
9b6575a
100644
(file)
--- a/
client/src/variants/Royalrace.js
+++ b/
client/src/variants/Royalrace.js
@@
-2,11
+2,15
@@
import { ChessRules } from "@/base_rules";
import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
-export c
onst VariantRules = c
lass RoyalraceRules extends ChessRules {
+export class RoyalraceRules extends ChessRules {
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
+ static get HasCastle() {
+ return false;
+ }
+
static get HasEnpassant() {
return false;
}
static get HasEnpassant() {
return false;
}
@@
-133,15
+137,6
@@
export const VariantRules = class RoyalraceRules extends ChessRules {
return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT]);
}
return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT]);
}
- // What are the king moves from square x,y ?
- getPotentialKingMoves(sq) {
- return this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- "oneStep"
- );
- }
-
filterValid(moves) {
if (moves.length == 0) return [];
const color = this.turn;
filterValid(moves) {
if (moves.length == 0) return [];
const color = this.turn;