X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSchess.js;h=5f5857197751990053899f7c95effbad801f1a76;hp=d8e1b1c5c9a08e84ca62690d6cf8f90876870a03;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Schess.js b/client/src/variants/Schess.js index d8e1b1c5..5f585719 100644 --- a/client/src/variants/Schess.js +++ b/client/src/variants/Schess.js @@ -78,9 +78,9 @@ export class SchessRules extends ChessRules { ); } - static GenRandInitFen(randomness) { + static GenRandInitFen(options) { return ( - ChessRules.GenRandInitFen(randomness).slice(0, -2) + + ChessRules.GenRandInitFen(options).slice(0, -2) + // Add pieceFlags + pocket "1111111111111111 - 1111" ); @@ -221,13 +221,13 @@ export class SchessRules extends ChessRules { getPotentialHawkMoves(sq) { return this.getSlideNJumpMoves(sq, V.steps[V.BISHOP]).concat( - this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], "oneStep") + this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], 1) ); } getPotentialElephantMoves(sq) { return this.getSlideNJumpMoves(sq, V.steps[V.ROOK]).concat( - this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], "oneStep") + this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], 1) ); } @@ -242,26 +242,14 @@ export class SchessRules extends ChessRules { isAttackedByHawk(sq, color) { return ( this.isAttackedBySlideNJump(sq, color, V.HAWK, V.steps[V.BISHOP]) || - this.isAttackedBySlideNJump( - sq, - color, - V.HAWK, - V.steps[V.KNIGHT], - "oneStep" - ) + this.isAttackedBySlideNJump(sq, color, V.HAWK, V.steps[V.KNIGHT], 1) ); } isAttackedByElephant(sq, color) { return ( this.isAttackedBySlideNJump(sq, color, V.ELEPHANT, V.steps[V.ROOK]) || - this.isAttackedBySlideNJump( - sq, - color, - V.ELEPHANT, - V.steps[V.KNIGHT], - "oneStep" - ) + this.isAttackedBySlideNJump(sq, color, V.ELEPHANT, V.steps[V.KNIGHT], 1) ); } @@ -330,9 +318,11 @@ export class SchessRules extends ChessRules { static get VALUES() { return Object.assign( - {}, - ChessRules.VALUES, - { 'h': 5, 'e': 7 } + { + 'h': 5, + 'e': 7 + }, + ChessRules.VALUES ); }