X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCrazyhouse.js;h=984c902f6ded2b1d24aed02cd8d4794f3c6693a0;hb=f9c36b2da005b596ad656f4b6cc4e09ef3c656f1;hp=d7d82b8c48d36e78f34592c024c1f0cad9bc642b;hpb=78d64531113d4b5045ff588dd43f301a332ebae8;p=vchess.git diff --git a/client/src/variants/Crazyhouse.js b/client/src/variants/Crazyhouse.js index d7d82b8c..984c902f 100644 --- a/client/src/variants/Crazyhouse.js +++ b/client/src/variants/Crazyhouse.js @@ -28,8 +28,8 @@ export const VariantRules = class CrazyhouseRules extends ChessRules { }); } - static GenRandInitFen() { - return ChessRules.GenRandInitFen() + " 0000000000 -"; + static GenRandInitFen(randomness) { + return ChessRules.GenRandInitFen(randomness) + " 0000000000 -"; } getFen() { @@ -38,6 +38,17 @@ export const VariantRules = class CrazyhouseRules extends ChessRules { ); } + getFenForRepeat() { + return ( + this.getBaseFen() + "_" + + this.getTurnFen() + "_" + + this.getFlagsFen() + "_" + + this.getEnpassantFen() + "_" + + this.getReserveFen() + "_" + + this.getPromotedFen() + ); + } + getReserveFen() { let counts = new Array(10); for ( @@ -104,7 +115,7 @@ export const VariantRules = class CrazyhouseRules extends ChessRules { } // Used by the interface: - getReservePpath(color, index) { + getReservePpath(index, color) { return color + V.RESERVE_PIECES[index]; }