Beispiel #1
0
 // 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();
     }
 }
Beispiel #2
0
        public void RemoveBehaviorSet(Type behaviorSet)
        {
            DebugTools.Assert(behaviorSet.IsAssignableFrom(typeof(BehaviorSet)));

            if (BehaviorSets.ContainsKey(behaviorSet))
            {
                BehaviorSets.Remove(behaviorSet);
                SortActions();
            }
        }
Beispiel #3
0
        // 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));
            }
        }
Beispiel #4
0
        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));
            }
        }
Beispiel #5
0
 public override void Setup()
 {
     base.Setup();
     BehaviorSets.Add(typeof(PathingDummyBehaviorSet), new PathingDummyBehaviorSet(SelfEntity));
     SortActions();
 }