public int CompareTo(ISpecificSport compareSport) { if (compareSport == null) { return(1); } if (GetResult() - compareSport.GetResult() > 0) { return(1); } if (GetResult() - compareSport.GetResult() < 0) { return(-1); } return(0); }
public void Add(ISpecificSport sport) { if (sport == null) { throw new Exception("Null sports are forbidden"); } if (!sport.IsSuit(this)) { return; } int i = Find(sport.GetSportName()); if (i != -1) { this[sport.GetSportName()] = sport; } else { _SpecificSport.Add(sport); _score += sport.GetResult(); } }
public bool Equals(ISpecificSport other) { return(this.GetResult() == other.GetResult() && this.GetSportName() == other.GetSportName()); }