public bool Equals(GameSong other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(other.GetHashCode() == this.GetHashCode()); }
/// <summary> /// Removes a GameSong from the list of playable songs. The given GameSong's Hashcode is used to find which /// song should be removed. /// </summary> /// <param name="song">The GameSong to remove.</param> public void RemoveSong(GameSong song) { if (_songs.Contains(song)) { _songs.Remove(song); } else { throw new Exception("SongManager does not contain song with hashcode: " + song.GetHashCode()); } }