public static void Queue(IEnumerable <ProfileBehavior> profileBehaviors, ShouldRunCondition condition, string name = "") { var behaviorList = profileBehaviors.ToList(); if (string.IsNullOrWhiteSpace(name)) { name = behaviorList.Aggregate(name, (current, behavior) => current + (behavior.ToString() + ",")); } var item = new QueueItem { Name = name, Nodes = behaviorList, Condition = condition, }; Queue(item); if (!BotMain.IsRunning || BotMain.IsPausedForStateExecution) { BehaviorTreeExecutor.CreateBotThread(); } }
public static void Queue(ProfileBehavior profileBehavior, ShouldRunCondition condition) { Queue(new List <ProfileBehavior> { profileBehavior }, condition); }