public static void Fight(IFighter player, IFighter rival, Queue <Fighter> rivalsQueue) { RoundVerdict roundVerdict = new RoundVerdict(); FightVerdictOnPoints fightVerdict = new FightVerdictOnPoints(); string gameStatus = "continues"; int getVerdictDeterminant = 0; FightHeader.Animation(); FightersInfo.Compare(player, rival); CountingDown.CountBeforeFight(); Contracts.Display(player); for (int i = 1; i <= 3; i++) { RoundHeader.Display(i); Round(player, rival, i, ref gameStatus, ref roundVerdict); if (gameStatus == "Winn") { rivalsQueue.Dequeue(); break; } else if (gameStatus == "Loss") { break; } getVerdictDeterminant += 1; } if (getVerdictDeterminant == 3) { fightVerdict.GetFightVerdict(roundVerdict, rivalsQueue, player); } }
public static void Round(IFighter player, IFighter rival, int roundNumber, ref string GameStatus, ref RoundVerdict roundVerdict) { player.ResetEnergy(); rival.ResetEnergy(); int getRoundVerdictDeterminant = 0; for (int j = 0; j < 6; j++) { if (j % 2 == 0) { Thread.Sleep(2000); Action(player, rival, roundNumber, ref GameStatus); } else { Thread.Sleep(2000); Action(rival, player, roundNumber, ref GameStatus); } if (GameStatus == "Winn" || GameStatus == "Loss") { break; } getRoundVerdictDeterminant += 1; } if (getRoundVerdictDeterminant == 6) { roundVerdict.GetRoundVerdict(player, rival, roundNumber); } Console.ReadKey(); }