+ setOtherVariables(fen)
+ {
+ super.setOtherVariables(fen);
+ // Local stack of non-capturing checkered moves:
+ this.cmoves = [];
+ const cmove = fen.split(" ")[5];
+ if (cmove == "-")
+ this.cmoves.push(null);
+ else
+ {
+ this.cmoves.push({
+ start: ChessRules.SquareToCoords(cmove.substr(0,2)),
+ end: ChessRules.SquareToCoords(cmove.substr(2)),
+ });
+ }
+ }
+
+ static IsGoodFen(fen)
+ {
+ if (!ChessRules.IsGoodFen(fen))
+ return false;
+ const fenParts = fen.split(" ");
+ if (fenParts.length != 6)
+ return false;
+ if (fenParts[5] != "-" && !fenParts[5].match(/^([a-h][1-8]){2}$/))
+ return false;
+ return true;
+ }
+