public override int GetHashCode() { var hashCode = 505786036; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Key); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Hash); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(SongName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(SongSubName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LevelAuthorName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(SongAuthorName); hashCode = hashCode * -1521134295 + EqualityComparer <List <DifficultyStats> > .Default.GetHashCode(Diffs); hashCode = hashCode * -1521134295 + Bpm.GetHashCode(); hashCode = hashCode * -1521134295 + PlayedCount.GetHashCode(); hashCode = hashCode * -1521134295 + Upvotes.GetHashCode(); hashCode = hashCode * -1521134295 + Downvotes.GetHashCode(); hashCode = hashCode * -1521134295 + Heat.GetHashCode(); hashCode = hashCode * -1521134295 + Rating.GetHashCode(); return(hashCode); }
public void Downvote(ulong id) { if (Downvotes.Contains(id)) { return; } if (Upvotes.Contains(id)) { Upvotes.Remove(id); } Downvotes.Add(id); }
public void DownvotePost(User user) { var isDownvoted = Downvotes.Contains(user); if (!isDownvoted) { Downvotes.Add(user); if (Upvotes.Contains(user)) { var index = Upvotes.IndexOf(user); Upvotes.RemoveAt(index); } } else { var index = Downvotes.IndexOf(user); Downvotes.RemoveAt(index); } }