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)); } }
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)); } }
public void AddScore(string name, int guesses) { gameScore newScore = new gameScore(name, guesses); this.scores.Add(newScore); }