Пример #1
0
        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()"))
                            ))
                    ));

        }
Пример #2
0
        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()"))
                                             ))
                                     )));
        }
Пример #3
0
 public Inverter(Composite child)
     : base(child)
 {
 }
Пример #4
0
 public SwitchArgument(Composite branch, T requiredValue = default(T))
 {
     Branch        = branch;
     RequiredValue = requiredValue;
 }
Пример #5
0
 public Switch(Func <T> statement, Composite defaultArgument, params SwitchArgument <T>[] args) : this(statement, args)
 {
     Default = defaultArgument;
 }
Пример #6
0
 public DecoratorContinue(CanRunDecoratorDelegate func, Composite decorated)
     : base(func, decorated)
 {
 }
Пример #7
0
 public DecoratorContinue(Composite child)
     : base(child)
 {
 }
Пример #8
0
 public UntilFailure(Composite child)
     : base(child)
 {
 }
Пример #9
0
 public ProbabilitySelection(Composite branch, double chanceToExecute)
 {
     Branch          = branch;
     ChanceToExecute = chanceToExecute;
 }
Пример #10
0
 /// <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);
 }
Пример #11
0
 /// <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)
 {
 }
Пример #12
0
 /// <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);
 }
Пример #13
0
 public Decorator(Composite child)
     : base(child)
 {
 }
Пример #14
0
 public Decorator(CanRunDecoratorDelegate runFunc, Composite child)
     : this(child)
 {
     Runner = runFunc;
 }