Example #1
0
 internal bool Exists(Move move, Field near, Field far)
 {
     bool result = false;
     if (move.Hash == 0)
     {
         if (!CanMove(near, far))
             throw new InvalidOperationException();
         {
             Use();
             near.Free();
             far.Free();
         }
         result = move.Update(board);
         {
             Free();
             near.Use();
             far.Use();
         }
         return result;
     }
     return board.Exists(move.Hash);
 }
Example #2
0
 internal bool UndoMove(Move move, Field near, Field far)
 {
     if (!CanUndoMove(near, far)) return false;
     if (Free() && near.Use() && far.Use())
     {
         board.UndoMove(this, near, far, move);
         return true;
     }
     return false;
 }