public int CompareTo(Competitor <T> other) { if (other == null) { return(1); } if (Points == other.Points) { return(0); } return((Points > other.Points) ? 1 : (-1)); }
public Competitor <T> EnterCompetitor(T competitor) { if (competitor == null) { return(null); } foreach (Competitor <T> competitor3 in Competitors) { if (competitor.Equals(competitor3.theObject)) { return(competitor3); } } Competitor <T> competitor2 = new Competitor <T>(competitor); Competitors.Add(competitor2); return(competitor2); }
protected bool Equals(Competitor <T> other) { return(EqualityComparer <T> .Default.Equals(theObject, other.theObject)); }
public bool RemoveCompetitor(Competitor <T> competitor) { return(RemoveCompetitor(competitor.Value)); }
public CompetitionResults(List <Competitor <T> > competitors) { Winner = ((competitors.Count > 0 && competitors[0].Points > 0) ? competitors[0] : null); }