X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCapture.js;h=f919c60e7245037732fc92861810a18e970039e7;hb=HEAD;hp=c5f86dcd1c19b0d6c252191d95c63b06155d566b;hpb=8e346ebebfdaec1538f9728fa7a279027c990f78;p=vchess.git diff --git a/client/src/variants/Capture.js b/client/src/variants/Capture.js index c5f86dcd..f919c60e 100644 --- a/client/src/variants/Capture.js +++ b/client/src/variants/Capture.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class CaptureRules extends ChessRules { + // Trim all non-capturing moves static KeepCaptures(moves) { return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1); @@ -43,4 +44,5 @@ export class CaptureRules extends ChessRules { return V.KeepCaptures(moves); return moves; } + };