Пример #1
0
 /// <summary>
 /// Checks the column for defence.
 /// </summary>
 /// <returns>The column for defence.</returns>
 /// <param name="gridHandler">Grid handler.</param>
 /// <param name="totalTurns">Total turns.</param>
 /// <param name="lastUsedCellID">Last used cell I.</param>
 /// <param name="opponentValue">Opponent value.</param>
 private int CheckColumnForDefence(GridHandler gridHandler, int totalTurns, int lastUsedCellID, C.CellState opponentValue)
 {
     GridHandler.GridAnalysisForDefence analysis = gridHandler.GetColumnAnalysis(lastUsedCellID, opponentValue);
     if (analysis.isCellHasEmptySpace)
     {
         if (analysis.isOpponentWinning)
         {
             return(analysis.proposedCellID);
         }
     }
     return(-1);
 }