// These 2 methods will be used eventually if / when we get a director AI public void AddBehaviorSet <T>(T behaviorSet, bool sort = true) where T : BehaviorSet { if (BehaviorSets.TryAdd(typeof(T), behaviorSet) && sort) { SortActions(); } }
public void RemoveBehaviorSet(Type behaviorSet) { DebugTools.Assert(behaviorSet.IsAssignableFrom(typeof(BehaviorSet))); if (BehaviorSets.ContainsKey(behaviorSet)) { BehaviorSets.Remove(behaviorSet); SortActions(); } }
// These 2 methods will be used eventually if / when we get a director AI public void AddBehaviorSet <T>(T behaviorSet, bool sort = true) where T : BehaviorSet { if (BehaviorSets.TryAdd(typeof(T), behaviorSet) && sort) { SortActions(); } if (BehaviorSets.Count == 1 && !EntitySystem.Get <AiSystem>().IsAwake(this)) { IoCManager.Resolve <IEntityManager>() .EventBus .RaiseEvent(EventSource.Local, new SleepAiMessage(this, false)); } }
public void RemoveBehaviorSet(Type behaviorSet) { DebugTools.Assert(behaviorSet.IsAssignableFrom(typeof(BehaviorSet))); if (BehaviorSets.ContainsKey(behaviorSet)) { BehaviorSets.Remove(behaviorSet); SortActions(); } if (BehaviorSets.Count == 0) { IoCManager.Resolve <IEntityManager>() .EventBus .RaiseEvent(EventSource.Local, new SleepAiMessage(this, true)); } }
public override void Setup() { base.Setup(); BehaviorSets.Add(typeof(PathingDummyBehaviorSet), new PathingDummyBehaviorSet(SelfEntity)); SortActions(); }