Пример #1
0
 void Ending()
 {
     if (!GM.pawnPositionsIntoLongString.Contains("W"))//aiWinPlayerCantMove
     {
         isEndGameTriggered = true;
         aiScoreCount++;
         gameOverIndex = 1;
     }
     else if (!GM.pawnPositionsIntoLongString.Contains("B"))//playerWinAiCantMove
     {
         isAILost = true;
         BM.AILostRemoveMoves2();
         isEndGameTriggered = true;
         playerScoreCount++;
         gameOverIndex = 2;
     }
     else if (GM.threeLetters[0].Contains("B"))//ai Cross finish line
     {
         isEndGameTriggered = true;
         aiScoreCount++;
         gameOverIndex = 3;
     }
     else if (GM.threeLetters[2].Contains("W")) //player Cross finish line
     {
         isAILost = true;
         BM.AILostRemoveMoves2();
         isEndGameTriggered = true;
         playerScoreCount++;
         gameOverIndex = 4;
     }
     else if (!BM.isAICanMove) //print("Bot unable to move, player won!");
     {
         isAILost = true;
         BM.AILostRemoveMoves2();
         isEndGameTriggered = true;
         playerScoreCount++;
         gameOverIndex = 5;
     }
     else if (!GM.isCanPlay && GM.isPlayerTurn)//print("plyer cant move, bot won");
     {
         aiScoreCount++;
         isEndGameTriggered = true;
         gameOverIndex      = 6;
     }
 }