public String LogColor(String ColorName) { ColorName = ColorName.ToLower().Replace(" ", ""); if (colorCounts.ContainsKey(ColorName)) { colorCounts[ColorName].VoteCount++; } else { try { if (ColorName.ToLower() == "lawngreen") { throw new Exception("Reserved color"); } colorCounts.Add(ColorName, new ColorCount() { color = (Color)ColorConverter.ConvertFromString(ColorName), VoteCount = 1 }); } catch { return("Sorry, bruh. I dont know that one. I know that one."); } } VoteDictChanged?.Invoke(this, new EventArgs()); return("Noice. I know that one."); }
public void ResetColorDict() { colorCounts = new Dictionary <String, ColorCount>(); VoteDictChanged?.Invoke(this, new EventArgs()); }