X-Git-Url: https://git.auder.net/images/pieces/%22%20%20V.getPpath%28board%5Bi%5D%5Bj%5D%29%20%20%20%22.svg?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCapture.js;h=f919c60e7245037732fc92861810a18e970039e7;hb=b0116a67818668f55cd2a3b3a323b2c91b5bc332;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; } + };