示例#1
0
 public bool PlaceCell(int row, int col)
 {
     if (MapList.Count(c => c == CellType._AVAILABLE) == 0)
     {
         return(false);
     }
     if (row == picked.Row && col == picked.Col)
     {
         return(false);
     }
     if (Map[row, col] == CellType._AVAILABLE)
     {
         Map[row, col] = picked.Type;
         if (picked.Type == CellType.RED_ && row == 0)
         {
             Map[row, col] = CellType.RED_K;
         }
         if (picked.Type == CellType.BLACK_ && row == 7)
         {
             Map[row, col] = CellType.BLACK_K;
         }
         Map[picked.Row, picked.Col] = CellType._EMPTY;
         curr = CellType._NONE;
         ResetPick();
         if (Hit(row, col))
         {
             TryPickAgain(row, col);
         }
         return(true);
     }
     return(false);
 }