public void RemoveListner(ETriggerType2 typeID, int eventID) { if (this.tMap.ContainsKey(typeID) && this.tMap[typeID].ContainsKey(eventID)) { this.tMap[typeID].Remove(eventID); } }
public void RemoveListner(ETriggerType2 typeID) { if (this.tMap.ContainsKey(typeID)) { this.tMap.Remove(typeID); } }
public void AddListener(TriggerEvent2 trigger) { if (trigger == null) { return; } ETriggerType2 typeID = trigger.TypeID; int eventID = trigger.EventID; if (!this.tMap.ContainsKey(typeID)) { this.tMap.Add(typeID, new Dictionary <int, Dictionary <string, TriggerEvent2> >()); if (!this.tMap.ContainsKey(typeID)) { throw new InsufficientMemoryException(); } } if (!this.tMap[typeID].ContainsKey(eventID)) { this.tMap[typeID].Add(eventID, new Dictionary <string, TriggerEvent2>()); if (!this.tMap[typeID].ContainsKey(eventID)) { throw new InsufficientMemoryException(); } } if (!this.tMap[typeID][eventID].ContainsKey(trigger.TriggerID)) { this.tMap[typeID][eventID].Add(trigger.TriggerID, trigger); } }
public TriggerEvent2(ITriggerCreatorParam param) { if (param != null) { this.type_id = param.TypeID; this.event_id = param.EventID; this.trigger_id = param.TriggerID; this.func_conditions = param.Func_conditions; this.func_actions = param.Func_actions; } }
public void RemoveListner(TriggerEvent2 trigger) { if (trigger == null) { return; } ETriggerType2 typeID = trigger.TypeID; int eventID = trigger.EventID; string triggerID = trigger.TriggerID; if (this.tMap.ContainsKey(typeID) && this.tMap[typeID].ContainsKey(eventID) && this.tMap[typeID][eventID].ContainsKey(triggerID)) { this.tMap[typeID][eventID].Remove(triggerID); } }
public void Trigger2(ITriggerDoActionParam param) { if (param == null) { return; } ETriggerType2 typeID = param.TypeID; int eventID = param.EventID; if (this.tMap.ContainsKey(typeID) && this.tMap[typeID].ContainsKey(eventID)) { Dictionary <string, TriggerEvent2> dictionary = this.tMap[typeID][eventID]; foreach (KeyValuePair <string, TriggerEvent2> current in dictionary) { if (current.Value.CheckConditions(param)) { current.Value.DoActions(param); } } } }