public void WatcherEngineExecution(RuleManager.EngineMessage msg, ActionFunction del, string targetDel, Entity watcher, string valueDel) { for (int i = 0; i < RuleManager.EngineAction.Count; i++) { var tmp = RuleManager.EngineAction.ElementAt(i); if (tmp.Equals(msg)) { del(targetDel, watcher, valueDel); return; } } }
public void WatcherActionEngine(RuleManager.EngineMessage msg, ActionFunction del, string targetDel, Entity watcher, string valueDel) { Entity.GetComponent <CollisionComponent>().AddOnCollisionHandler(delegate(Fixture sender, Fixture other, Contact contact) { var tmp = new RuleManager.EngineMessage(); tmp.Action = RuleManager.ActionEngine.Collision; tmp.entitybase = EntityManager.GetAllEntities().Find(i => i.Guid == (Guid)sender.Body.Tag); tmp.entityFocus = EntityManager.GetAllEntities().Find(i => i.Guid == (Guid)other.Body.Tag); RuleManager.EngineAction.Enqueue(tmp); return(true); }); listWatcherEngine.Add(msg, new Object[4] { del, targetDel, watcher, valueDel }); WatcherSet = true; }