public void NextMinute() { if (Concluded) { throw new Exception("Fight already finished"); } int round = ++Minute / 3; Block block = new Block(this); var blockOutcome = block.Run(); FightStats blockStats = new FightStats(blockOutcome.Punches, block.Knockdowns[0], block.Knockdowns[1]); FightStats[round].Append(blockStats); Punches[round].AddRange(blockOutcome.Punches); if (blockOutcome.Stoppage != -1) { TimeOfStoppage = blockOutcome.Stoppage + Minute * 60; EndOfRound(); return; } F1.RecoverFor(60); F2.RecoverFor(60); if ((1 + Minute) % 3 == 0) { EndOfRound(); } }
public void EndOfRound() { int round = CurrentRound(); for (int j = 0; j < Fight.Judges.Length; ++j) //Score Round { int[] roundScore = Fight.Judges[j].ScoreRound(Punches[round], FightStats[round]); Scorecards[j, 0] += roundScore[0]; Scorecards[j, 1] += roundScore[1]; } ; if (Concluded) //If not concluded, set up the next round { Outcome = DetermineFightResult(); } else { F1.RecoverFor(60); F2.RecoverFor(60); InitNextRound(); } }