X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCapture.js;h=f919c60e7245037732fc92861810a18e970039e7;hp=c5f86dcd1c19b0d6c252191d95c63b06155d566b;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hpb=31c535953c843b28434a7fcdf7b4da0b376774ab 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; } + };