protected override Composite CreateBehavior() { return _root ?? (_root = new PrioritySelector( new Decorator( ret => wp.Distance(ObjectManager.Me.Location) > 5, new Sequence( new Action(ret => TreeRoot.StatusText = "Moving to location"), new Action(ret => Navigator.MoveTo(wp)))), new Decorator( ret => !ObjectManager.Me.HasAura("Vault Cracking Toolset"), new Sequence( new Action(ret => q14122bank[0].Interact()), new Action(ret => StyxWoW.SleepForLagDuration()) )), new Decorator( ret => !IsAttached, new Sequence( new Action(ret => Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)), new Action(ret => IsAttached = true))), new Decorator( ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted, new PrioritySelector( new Decorator( ret => IsAttached, new Sequence( new Action(ret => Styx.Helpers.Logging.Write("Detaching")), new Action(ret => Lua.Events.DetachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)), new Action(ret => IsBehaviorDone = true) )))), new Decorator( ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted && ObjectManager.Me.HasAura("Vault Cracking Toolset"), new Sequence( new Action(ret => Lua.DoString("VehicleExit()")) )) )); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator( ret => wp.Distance(ObjectManager.Me.Location) > 5, new Sequence( new Action(ret => TreeRoot.StatusText = "Moving to location"), new Action(ret => Navigator.MoveTo(wp)))), new Decorator( ret => !ObjectManager.Me.HasAura("Vault Cracking Toolset"), new Sequence( new Action(ret => q14122bank[0].Interact()), new Action(ret => StyxWoW.SleepForLagDuration()) )), new Decorator( ret => !IsAttached, new Sequence( new Action(ret => Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)), new Action(ret => IsAttached = true))), new Decorator( ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted, new PrioritySelector( new Decorator( ret => IsAttached, new Sequence( new Action(ret => Styx.Helpers.Logging.Write("Detaching")), new Action(ret => Lua.Events.DetachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)), new Action(ret => IsBehaviorDone = true) )))), new Decorator( ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted&& ObjectManager.Me.HasAura("Vault Cracking Toolset"), new Sequence( new Action(ret => Lua.DoString("VehicleExit()")) )) ))); }
public Inverter(Composite child) : base(child) { }
public SwitchArgument(Composite branch, T requiredValue = default(T)) { Branch = branch; RequiredValue = requiredValue; }
public Switch(Func <T> statement, Composite defaultArgument, params SwitchArgument <T>[] args) : this(statement, args) { Default = defaultArgument; }
public DecoratorContinue(CanRunDecoratorDelegate func, Composite decorated) : base(func, decorated) { }
public DecoratorContinue(Composite child) : base(child) { }
public UntilFailure(Composite child) : base(child) { }
public ProbabilitySelection(Composite branch, double chanceToExecute) { Branch = branch; ChanceToExecute = chanceToExecute; }
/// <summary> /// Creates a new Wait decorator with the specified timeout, and child composite. /// </summary> /// <param name = "timeoutSeconds"></param> /// <param name = "child"></param> public Wait(int timeoutSeconds, Composite child) : base(child) { Timeout = new TimeSpan(0, 0, timeoutSeconds); }
/// <summary> /// Creates a new Wait decorator with an 'infinite' timeout, the specified run delegate, and a child composite. /// </summary> /// <param name = "runFunc"></param> /// <param name = "child"></param> public Wait(CanRunDecoratorDelegate runFunc, Composite child) : this(int.MaxValue, runFunc, child) { }
/// <summary> /// Creates a new Wait decorator using the specified timeout, run delegate, and child composite. /// </summary> /// <param name = "timeoutSeconds"></param> /// <param name = "runFunc"></param> /// <param name = "child"></param> public Wait(int timeoutSeconds, CanRunDecoratorDelegate runFunc, Composite child) : base(runFunc, child) { Timeout = new TimeSpan(0, 0, timeoutSeconds); }
public Decorator(Composite child) : base(child) { }
public Decorator(CanRunDecoratorDelegate runFunc, Composite child) : this(child) { Runner = runFunc; }