public static void Lookup(string EventText, string User) { if (EventDictionary.Keys.Contains(EventText)) { ActionQueue.Add(new KeyValuePair <string, EventInfo>(EventText, EventDictionary[EventText])); TimerCooldown.AddNewEventText(EventText, User); } }
public static void Lookup(string EventText, string User, int bits) { KeyValuePair <string, EventInfo> Event = EventDictionary.FirstOrDefault(it => EventText.Contains(it.Key)); Console.WriteLine(Event.Key); if (!Event.Equals(default(KeyValuePair <string, EventInfo>)) && bits >= Event.Value.BitCost) { Console.WriteLine(Event.Key); ActionQueue.Add(Event); TimerCooldown.AddNewEventText(Event.Key, User, bits); } }
public static void Lookup(string EventText, string User, int bits) { KeyValuePair <string, EventInfo> Event = EventDictionary.FirstOrDefault(it => EventText.IndexOf(it.Key, StringComparison.OrdinalIgnoreCase) >= 0); Console.WriteLine(Event.Key); if (!Event.Equals(default(KeyValuePair <string, EventInfo>)) && bits >= Event.Value.BitCost) { Console.WriteLine(Event.Key); ActionQueue.Add(Event); TimerCooldown.AddNewEventText(Event.Key, User, bits); } }