Commit | Line | Data |
---|---|---|
dbc79ee6 BA |
1 | import { MakrukRules } from "@/variants/Makruk"; |
2 | ||
3 | export class MakpongRules extends MakrukRules { | |
4 | ||
5 | filterValid(moves) { | |
6 | const color = this.turn; | |
7 | if (this.underCheck(color)) { | |
8 | // Filter out all moves involving king | |
9 | return super.filterValid(moves.filter(m => m.vanish[0].p != V.KING)); | |
10 | } | |
11 | return super.filterValid(moves); | |
12 | } | |
13 | ||
14 | }; |