예제 #1
0
 public static Composite MoveToLineOfSight(ValueRetriever <DiaUnit> unit)
 {
     return
         (new Decorator(ret => unit != null && !unit(ret).InLineOfSight,
                        CommonBehaviors.MoveToLos(unit, true)
                        ));
 }
예제 #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)
 {
 }
예제 #3
0
파일: Movement.cs 프로젝트: ipo/AGBA
 public static Composite MoveToLineOfSight(ValueRetriever<DiaUnit> unit)
 {
     return
         new Decorator(ret => unit != null,
             CommonBehaviors.MoveToLos(unit, true)
         );
 }
예제 #4
0
파일: SpellCast.cs 프로젝트: ipo/AGBA
 /// <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();
 }
예제 #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;
 }
예제 #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));
        }
예제 #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;
        }
예제 #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;
 }
예제 #11
0
파일: Spell.cs 프로젝트: murrain/Mammon
        /// <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);
        }
예제 #13
0
파일: Spell.cs 프로젝트: 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());
            })
            );
        }
예제 #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;
                }
            }
예제 #15
0
파일: Spell.cs 프로젝트: 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);
 }
예제 #16
0
파일: Spell.cs 프로젝트: 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);
 }
예제 #17
0
파일: SpellCast.cs 프로젝트: ipo/AGBA
 /// <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)
 {
 }
예제 #18
0
파일: Spell.cs 프로젝트: 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);
 }
예제 #19
0
파일: SpellCast.cs 프로젝트: ipo/AGBA
 /// <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)
 {
 }
예제 #20
0
파일: SpellCast.cs 프로젝트: ipo/AGBA
 /// <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)
 {
 }
예제 #21
0
파일: Movement.cs 프로젝트: ipo/AGBA
 public static Composite MoveTo(ValueRetriever<Vector3> position, float range)
 {
     return CommonBehaviors.MoveAndStop(position, range, true, "Target Position");
 }
예제 #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)
 {
 }
예제 #23
0
파일: GenericRoutine.cs 프로젝트: ipo/AGBA
 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))));
 }
예제 #24
0
 public static Composite MoveTo(ValueRetriever <Vector3> position, float range)
 {
     return(CommonBehaviors.MoveAndStop(position, range, true, "Target Position"));
 }
예제 #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)))));
 }
예제 #26
0
파일: GenericRoutine.cs 프로젝트: ipo/AGBA
 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))));
 }
예제 #27
0
파일: Spell.cs 프로젝트: 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);
 }
예제 #28
0
파일: Spell.cs 프로젝트: 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);
 }
예제 #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)))));
 }