/// <summary> /// /// </summary> /// <returns>LeadingTeam</returns> public ScoreStatus GetLeadingTeam() { //assume home team is winning int roadScore = GetTeamScore(roadTeam); int homeScore = GetTeamScore(homeTeam); ScoreStatus leadingTeam = new ScoreStatus() { LeadingTeam = homeTeam, LeadingTeamScore = homeScore, TrailingTeam = roadTeam, TrailingTeamScore = roadScore }; if (roadScore > homeScore)//is road team winning? { leadingTeam.LeadingTeam = roadTeam; leadingTeam.LeadingTeamScore = roadScore; leadingTeam.TrailingTeam = homeTeam; leadingTeam.TrailingTeamScore = homeScore; } return(leadingTeam); }
/// <summary> /// /// </summary> /// <returns>string</returns> public string GetScore() { ScoreStatus leadingTeam = GetLeadingTeam(); return(String.Format("{0} {1}, {2} {3}", leadingTeam.LeadingTeam, leadingTeam.LeadingTeamScore, leadingTeam.TrailingTeam, leadingTeam.TrailingTeamScore)); }