Finished problems implementation. TODO: specify state for Crazyhouse,Grand. Improve...
[vchess.git] / public / javascripts / variants / Ultima.js
index 04ef29b..05fba2f 100644 (file)
@@ -7,6 +7,15 @@ class UltimaRules extends ChessRules
                return b; //usual piece
        }
 
+       static get PIECES() {
+               return ChessRules.PIECES.concat([V.IMMOBILIZER]);
+       }
+
+       static IsGoodFlags(flags)
+       {
+               return true; //anything is good: no flags
+       }
+
        initVariables(fen)
        {
                this.kingPos = {'w':[-1,-1], 'b':[-1,-1]};
@@ -36,7 +45,7 @@ class UltimaRules extends ChessRules
                this.epSquares = []; //no en-passant here
        }
 
-       setFlags(fen)
+       setFlags(fenflags)
        {
                // TODO: for compatibility?
                this.castleFlags = {"w":[false,false], "b":[false,false]};
@@ -599,7 +608,7 @@ class UltimaRules extends ChessRules
                return pieces["b"].join("") +
                        "/pppppppp/8/8/8/8/PPPPPPPP/" +
                        pieces["w"].join("").toUpperCase() +
-                       " 0000"; //TODO: flags?!
+                       " 0000 w"; //TODO: flags?!
        }
 
        getFlagsFen()