public void DeclareResult() { int runsDiff = Inning1.GetRunsScoredYet() - Inning2.GetRunsScoredYet(); if (runsDiff > 0) { Console.WriteLine("Result: Team {0} won the match by {1} runs.", Inning1.Team1.TeamName, runsDiff); return; } if (IsChasedSuccessfully()) { int wicketsRem = Inning2.GetRemainingWickets(); Console.WriteLine("Result: Team {0} won the match by {1} wickets.", Inning2.Team1.TeamName, wicketsRem); return; } Console.WriteLine("Result: Match Tied."); }
public bool IsChasedSuccessfully() { int runsDiff = Inning1.GetRunsScoredYet() - Inning2.GetRunsScoredYet(); return(runsDiff < 0); }