예제 #1
0
 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);
 }
예제 #2
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();
            }
        }
예제 #3
0
 public bool Equals(ISpecificSport other)
 {
     return(this.GetResult() == other.GetResult() && this.GetSportName() == other.GetSportName());
 }