Slight change in Ultima rules. TODO: merge with removed code 'isAttacked'
[vchess.git] / public / javascripts / variants / Magnetic.js
index b17bb74..ec2c975 100644 (file)
@@ -137,10 +137,11 @@ class MagneticRules extends ChessRules
                return moves;
        }
 
-       // TODO: verify this assertion
        atLeastOneMove()
        {
-               return true; //always at least one possible move
+               if (this.kingPos[this.turn][0] < 0)
+                       return false;
+               return true; //TODO: is it right?
        }
 
        underCheck(move)
@@ -205,19 +206,6 @@ class MagneticRules extends ChessRules
                }
        }
 
-       checkGameOver()
-       {
-               if (this.checkRepetition())
-                       return "1/2";
-
-               const color = this.turn;
-               // TODO: do we need "atLeastOneMove()"?
-               if (this.atLeastOneMove() && this.kingPos[color][0] >= 0)
-                       return "*";
-
-               return this.checkGameEnd();
-       }
-
        checkGameEnd()
        {
                // No valid move: our king disappeared