- // TODO: more subtle than that, require changing args: wp, bk and not just colors
- canTake(color1, color2)
+ static get PIECES() {
+ return ChessRules.PIECES.concat([V.ANTIKING]);
+ }
+
+ initVariables(fen)
+ {
+ super.initVariables(fen);
+ this.antikingPos = {'w':[-1,-1], 'b':[-1,-1]};
+ const position = fen.split(" ")[0].split("/");
+ for (let i=0; i<position.length; i++)
+ {
+ let k = 0;
+ for (let j=0; j<position[i].length; j++)
+ {
+ switch (position[i].charAt(j))
+ {
+ case 'a':
+ this.antikingPos['b'] = [i,k];
+ break;
+ case 'A':
+ this.antikingPos['w'] = [i,k];
+ break;
+ default:
+ let num = parseInt(position[i].charAt(j));
+ if (!isNaN(num))
+ k += (num-1);
+ }
+ k++;
+ }
+ }
+ }
+
+ canTake([x1,y1], [x2,y2])