Esempio n. 1
0
        public override bool Equals(object obj)
        {
            gameScore objectToCompare = obj as gameScore;

            if (objectToCompare == null)
            {
                return(false);
            }
            else
            {
                return(this.Guesses.Equals(objectToCompare) && this.Name.Equals(objectToCompare));
            }
        }
Esempio n. 2
0
        public int CompareTo(object obj)
        {
            gameScore objectToCompare = obj as gameScore;

            if (objectToCompare == null)
            {
                return(-1);
            }
            if (this.Guesses.CompareTo(objectToCompare.Guesses) == 0)
            {
                return(this.Name.CompareTo(objectToCompare.Name));
            }
            else
            {
                return(this.Guesses.CompareTo(objectToCompare.Guesses));
            }
        }
Esempio n. 3
0
        public void AddScore(string name, int guesses)
        {
            gameScore newScore = new gameScore(name, guesses);

            this.scores.Add(newScore);
        }
Esempio n. 4
0
 public void AddScore(string name, int guesses)
 {
     gameScore newScore = new gameScore(name, guesses);
     this.scores.Add(newScore);
 }