Exemplo n.º 1
0
 public static Composite MoveToLineOfSight(ValueRetriever <DiaUnit> unit)
 {
     return
         (new Decorator(ret => unit != null && !unit(ret).InLineOfSight,
                        CommonBehaviors.MoveToLos(unit, true)
                        ));
 }
Exemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SelfCast" /> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="extra">The extra.</param>
 /// <param name="succeedRunner">The succeed runner.</param>
 /// <param name="keepSpamming">Casts the spell multiple times for one second</param>
 /// <param name="contextChangeHandler"></param>
 /// <remarks>Created 2012-06-18</remarks>
 public SelfCast(SNOPower power, ValueRetriever <bool> extra = null, ActionSucceedDelegate succeedRunner       = null,
                 ValueRetriever <bool> keepSpamming          = null, ContextChangeHandler contextChangeHandler = null)
     : base(
         power, null, ctx => ZetaDia.CurrentWorldDynamicId, null, extra, succeedRunner, keepSpamming,
         contextChangeHandler)
 {
 }
Exemplo n.º 3
0
Arquivo: Movement.cs Projeto: ipo/AGBA
 public static Composite MoveToLineOfSight(ValueRetriever<DiaUnit> unit)
 {
     return
         new Decorator(ret => unit != null,
             CommonBehaviors.MoveToLos(unit, true)
         );
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpellCast"/> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="posRetriever">The pos retriever.</param>
 /// <param name="dynWorldRetriever">The dyn world retriever.</param>
 /// <param name="targetRetriever">The target retriever.</param>
 /// <param name="extra">The extra.</param>
 /// <remarks>Created 2012-06-18</remarks>
 public SpellCast(SNOPower power, ValueRetriever<Vector3> posRetriever = null, ValueRetriever<int> dynWorldRetriever = null, ValueRetriever<int> targetRetriever = null, ValueRetriever<bool> extra = null)
 {
     Power = power;
     PositionRetriever = posRetriever;
     DynamicWorldIdRetriever = dynWorldRetriever;
     TargetGuidRetriever = targetRetriever;
     ExtraCondition = extra;
 }
 private void browseFolderToSplitBtn_Click(object sender, System.EventArgs e)
 {
     /*
      * Get the Directory, Set the Path and Check if Can Continue
      */
     this._directoryOfVideosToSplit = ValueRetriever.GetDirectory();
     this._videoSplitter.SetDirectory(this._directoryOfVideosToSplit);
     this.splitVideosBtn.Enabled = this._videoSplitter.CanPerformSplit();
 }
 private void browseFolderToMergeBtn_Click(object sender, System.EventArgs e)
 {
     /*
      * Get the Directory, Set the Path and Check if Can Continue
      */
     this._directoryOfVideosToMerge = ValueRetriever.GetDirectory();
     this._videoMerger.SetDirectory(this._directoryOfVideosToMerge);
     this.mergeVideosBtn.Enabled = this._videoMerger.CanPerformMerge();
 }
Exemplo n.º 7
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SpellCast" /> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="posRetriever">The pos retriever.</param>
 /// <param name="dynWorldRetriever">The dyn world retriever.</param>
 /// <param name="targetRetriever">The target retriever.</param>
 /// <param name="extra">The extra.</param>
 /// <param name="suceedRunner">The suceed runner.</param>
 /// <remarks> Created 2012-06-18 </remarks>
 public SpellCast(SNOPower power, ValueRetriever <Vector3> posRetriever = null,
                  ValueRetriever <int> dynWorldRetriever = null, ValueRetriever <int> targetRetriever = null,
                  ValueRetriever <bool> extra            = null, ActionSucceedDelegate suceedRunner = null)
 {
     Power                   = power;
     PositionRetriever       = posRetriever;
     DynamicWorldIdRetriever = dynWorldRetriever;
     TargetGuidRetriever     = targetRetriever;
     ExtraCondition          = extra;
     SucceedRunner           = suceedRunner;
 }
Exemplo n.º 8
0
        public static Composite SprintMove(ValueRetriever <Vector3> location)
        {
            var move   = CommonBehaviors.MoveAndStop(location, 1f, true);
            var sprint = new Decorator(req => CanSprint,
                                       new Action(r =>
            {
                Actionmanager.Sprint();
                return(RunStatus.Failure);
            }));

            return(new PrioritySelector(sprint, move));
        }
Exemplo n.º 9
0
        private void browseWavBtn_Click(object sender, EventArgs e)
        {
            this._audioFile            = ValueRetriever.SelectFile();
            this.transcribeBtn.Enabled = !string.IsNullOrWhiteSpace(this._audioFile.FileName);
            if (!this.transcribeBtn.Enabled)
            {
                return;
            }

            this.CreateRecognizer(); //// Just to be sure
            this.SetFileLocation();
            this._completed = false;
        }
Exemplo n.º 10
0
 /// <summary>
 ///     Initializes a new instance of the SpellCast class.
 /// </summary>
 public SpellCast(SNOPower power, ValueRetriever <Vector3> positionRetriever = null,
                  ValueRetriever <int> dynamicWorldIdRetriever = null,
                  ValueRetriever <int> targetGuidRetriever     = null, ValueRetriever <bool> extraCondition = null,
                  ActionSucceedDelegate succeedRunner          = null, ValueRetriever <bool> keepSpamming   = null,
                  ContextChangeHandler contextChangeHandler    = null)
 {
     Power                   = power;
     PositionRetriever       = positionRetriever;
     DynamicWorldIdRetriever = dynamicWorldIdRetriever;
     TargetGuidRetriever     = targetGuidRetriever;
     ExtraCondition          = extraCondition;
     KeepSpamming            = keepSpamming;
     ContextChangeHandler    = contextChangeHandler;
     SucceedRunner           = succeedRunner;
 }
Exemplo n.º 11
0
        /// <summary>
        /// Casts the specified power.
        /// </summary>
        /// <param name="power">The sno power.</param>
        /// <param name="positionRetriver">The position retriver.</param>
        /// <param name="levelAreaRetriever">The level area retriever.</param>
        /// <param name="extraCondition">The extra condition if any.</param>
        /// <param name="powerType">Type of the power.</param>
        /// <param name="onUnit">The target acd GUID retriever.</param>
        /// <returns>
        ///   <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
        /// </returns>
        /// <remarks>Created 2012-04-09</remarks>
        public static Composite Cast(SNOPower power, ValueRetriever<Vector3> positionRetriver, ValueRetriever<int> levelAreaRetriever, int powerType, ValueRetriever<int> onUnit, ValueRetriever<bool> extraCondition)
        {
            return new Decorator(ret =>
            {
                bool canCast = PowerManager.CanCast(power);
                bool minReqs = extraCondition != null ? extraCondition(ret) : true;

                return minReqs && canCast;
            },
            new Action(ctx =>
            {
                Vector3 position = positionRetriver != null ? positionRetriver(ctx) : Vector3.Zero;
                int levelArea = levelAreaRetriever != null ? levelAreaRetriever(ctx) : 0;
                int acdGuid = onUnit != null ? onUnit(ctx) : -1;

                ZetaDia.Me.UsePower(power, position, levelArea, powerType, acdGuid);
            })
            );
        }
        public Dictionary <string, string> GetAttributes(string fileLocation)
        {
            if (!File.Exists(fileLocation))
            {
                throw new ArgumentException(@"The specified file does not exist", "fileLocation");
            }

            var rtn = new Dictionary <string, string>();
            var po  = Serializer.Deserialize <PurchaseOrderType>(File.ReadAllText(fileLocation));

            if (po != null)
            {
                rtn.Add("Bill to", ValueRetriever.RetrieveValue(po, poType => poType.billTo.name, "[Unspecified]"));
                rtn.Add("Ship to", ValueRetriever.RetrieveValue(po, poType => poType.shipTo.name, "[Unspecified]"));
                rtn.Add("Items", ValueRetriever.RetrieveValue(po, poType => poType.items.Count().ToString(CultureInfo.InvariantCulture), "0"));
            }

            return(rtn);
        }
Exemplo n.º 13
0
Arquivo: Spell.cs Projeto: ipo/AGBA
        /// <summary>
        /// Casts the specified power.
        /// </summary>
        /// <param name="power">The sno power.</param>
        /// <param name="positionRetriver">The position retriver.</param>
        /// <param name="levelAreaRetriever">The level area retriever.</param>
        /// <param name="extraCondition">The extra condition if any.</param>
        /// <param name="onUnit">The target acd GUID retriever.</param>
        /// <returns>
        ///   <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
        /// </returns>
        /// <remarks>Created 2012-04-09</remarks>
        public static Composite Cast(SNOPower power, ValueRetriever<Vector3> positionRetriver, ValueRetriever<int> levelAreaRetriever, ValueRetriever<int> onUnit, ValueRetriever<bool> extraCondition)
        {
            return new Decorator(ret =>
            {
                bool canCast = PowerManager.CanCast(power);
                bool minReqs = extraCondition != null ? extraCondition(ret) : true;

                return minReqs && canCast;
            },
            new Action(ctx =>
            {
                Vector3 position = positionRetriver != null ? positionRetriver(ctx) : Vector3.Zero;
                int worldId = levelAreaRetriever != null ? levelAreaRetriever(ctx) : 0;
                int acdGuid = onUnit != null ? onUnit(ctx) : -1;

                ZetaDia.Me.UsePower(power, position, worldId, acdGuid);
                Logger.WriteVerbose("Using power: {0}", power.ToString());
            })
            );
        }
Exemplo n.º 14
0
            private static void Augment(Node root, ODataSelectColumnExpression select, ValueRetriever valueRetriever)
            {
                var node = GetOrCreateMemberNode(root, select.Expression);

                if (node.Select == null)
                {
                    node.Select         = select;
                    node.ValueRetriever = valueRetriever;
                }
            }
Exemplo n.º 15
0
Arquivo: Spell.cs Projeto: ipo/AGBA
 /// <summary>
 /// Casts a spell on a unit.
 /// </summary>
 /// <param name="power">The sno power.</param>
 /// <param name="onUnit">The on unit.</param>
 /// <param name="extraRequirements">The extra requirements.</param>
 /// <returns>
 ///   <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
 /// </returns>
 /// <remarks>
 /// Created 2012-04-09
 /// </remarks>
 public static Composite CastOnUnit(SNOPower power, ValueRetriever<int> onUnit, ValueRetriever<bool> extraRequirements = null)
 {
     return Cast(power, null, null, onUnit, extraRequirements);
 }
Exemplo n.º 16
0
Arquivo: Spell.cs Projeto: ipo/AGBA
 /// <summary>
 /// Buffs the specified sno power.
 /// </summary>
 /// <param name="power">The sno power.</param>
 /// <param name="extraRequirements">The extra requirements.</param>
 /// <returns></returns>
 /// <remarks>Created 2012-04-09</remarks>
 public static Composite Buff(SNOPower power, ValueRetriever<bool> extraRequirements = null)
 {
     return Cast(power, pos => Vector3.Zero, null, extraRequirements);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpellCast"/> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="posRetriever">The pos retriever.</param>
 /// <param name="extra">The extra.</param>
 /// <remarks>Created 2012-06-18</remarks>
 public CastAtLocation(SNOPower power, ValueRetriever<Vector3> posRetriever, ValueRetriever<bool> extra = null)
     : base(power, posRetriever, ctx => ZetaDia.CurrentWorldDynamicId, null, extra)
 {
 }
Exemplo n.º 18
0
Arquivo: Spell.cs Projeto: ipo/AGBA
 /// <summary>
 /// Casts a spell on a Vector.
 /// </summary>
 /// <param name="power">The sno power.</param>
 /// <param name="position">The position.</param>
 /// <param name="extraRequirements">The extra requirements.</param>
 /// <returns>
 ///   <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
 /// </returns>
 /// <remarks>
 /// Created 2012-04-09
 /// </remarks>
 public static Composite CastAtLocation(SNOPower power, ValueRetriever<Vector3> position, ValueRetriever<bool> extraRequirements = null)
 {
     return Cast(power, position, null, extraRequirements);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SelfCast"/> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="extra">The extra.</param>
 /// <remarks>Created 2012-06-18</remarks>
 public SelfCast(SNOPower power, ValueRetriever<bool> extra = null)
     : base(power, null, ctx => ZetaDia.CurrentWorldDynamicId, null, extra)
 {
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CastOnUnit"/> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="targetRetriever">The target retriever.</param>
 /// <param name="extra">The extra.</param>
 /// <remarks>Created 2012-06-18</remarks>
 public CastOnUnit(SNOPower power, ValueRetriever<int> targetRetriever, ValueRetriever<bool> extra = null)
     : base(power, null, null, targetRetriever, extra)
 {
 }
Exemplo n.º 21
0
Arquivo: Movement.cs Projeto: ipo/AGBA
 public static Composite MoveTo(ValueRetriever<Vector3> position, float range)
 {
     return CommonBehaviors.MoveAndStop(position, range, true, "Target Position");
 }
Exemplo n.º 22
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="CastOnUnit" /> class.
 /// </summary>
 /// <param name="power">The power.</param>
 /// <param name="targetRetriever">The target retriever.</param>
 /// <param name="extra">The extra.</param>
 /// <param name="succeedRunner">The succeed runner.</param>
 /// <param name="keepSpamming">Casts the spell multiple times for one second</param>
 /// <param name="contextChangeHandler"></param>
 /// <remarks> Created 2012-06-18 </remarks>
 public CastOnUnit(SNOPower power, ValueRetriever <int> targetRetriever, ValueRetriever <bool> extra = null,
                   ActionSucceedDelegate succeedRunner       = null, ValueRetriever <bool> keepSpamming = null,
                   ContextChangeHandler contextChangeHandler = null)
     : base(power, null, null, targetRetriever, extra, succeedRunner, keepSpamming, contextChangeHandler)
 {
 }
Exemplo n.º 23
0
 private Composite CreateUseBuff(ValueRetriever<GenericRoutineSettings.SkillSetting> setting)
 {
     return new Decorator(ret => setting != null && setting(ret) != null && setting(ret).Type == UseType.EveryNSeconds,
         new Decorator(ret => setting(ret).ShouldUse,
             new Action(ret => setting(ret).Use(Vector3.Zero, -1))));
 }
Exemplo n.º 24
0
 public static Composite MoveTo(ValueRetriever <Vector3> position, float range)
 {
     return(CommonBehaviors.MoveAndStop(position, range, true, "Target Position"));
 }
Exemplo n.º 25
0
 private Composite CreateUseBuff(ValueRetriever <GenericRoutineSettings.SkillSetting> setting)
 {
     return(new Decorator(ret => setting != null && setting(ret) != null && setting(ret).Type == UseType.EveryNSeconds,
                          new Decorator(ret => setting(ret).ShouldUse,
                                        new Action(ret => setting(ret).Use(Vector3.Zero, -1)))));
 }
Exemplo n.º 26
0
 private Composite CreateUseSkill(ValueRetriever<GenericRoutineSettings.SkillSetting> setting)
 {
     return new Decorator(ret => setting != null && setting(ret) != null,
         new Decorator(ret => setting(ret).ShouldUse,
             new Action(ret => setting(ret).Use(CombatTargeting.Instance.FirstNpc.Position, CombatTargeting.Instance.FirstNpc.ACDGuid))));
 }
Exemplo n.º 27
0
Arquivo: Spell.cs Projeto: ipo/AGBA
 /// <summary>
 /// Casts the specified power.
 /// </summary>
 /// <param name="power">The sno power.</param>
 /// <param name="position">The position.</param>
 /// <param name="extraCondition">The extra condition if any.</param>
 /// <param name="onUnit">The target acd GUID retriever.</param>
 /// <returns><c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.</returns>
 /// <remarks>Created 2012-04-09</remarks>
 public static Composite Cast(SNOPower power, ValueRetriever<Vector3> position, ValueRetriever<int> onUnit, ValueRetriever<bool> extraCondition)
 {
     return Cast(power, position, ret => ZetaDia.Me.WorldDynamicId, onUnit, extraCondition);
 }
Exemplo n.º 28
0
Arquivo: Spell.cs Projeto: ipo/AGBA
 /// <summary>
 /// Casts an AOE spell. eg; "Wave of Force".
 /// </summary>
 /// <param name="power">The sno power.</param>
 /// <param name="extraRequirements">The extra requirements.</param>
 /// <returns>
 ///   <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
 /// </returns>
 /// <remarks>
 /// Created 2012-04-09
 /// </remarks>
 public static Composite CastAOESpell(SNOPower power, ValueRetriever<bool> extraRequirements)
 {
     return Cast(power, ret => Vector3.Zero, null, extraRequirements);
 }
Exemplo n.º 29
0
 private Composite CreateUseSkill(ValueRetriever <GenericRoutineSettings.SkillSetting> setting)
 {
     return(new Decorator(ret => setting != null && setting(ret) != null,
                          new Decorator(ret => setting(ret).ShouldUse,
                                        new Action(ret => setting(ret).Use(CombatTargeting.Instance.FirstNpc.Position, CombatTargeting.Instance.FirstNpc.ACDGuid)))));
 }