public static Composite MoveToLineOfSight(ValueRetriever <DiaUnit> unit) { return (new Decorator(ret => unit != null && !unit(ret).InLineOfSight, CommonBehaviors.MoveToLos(unit, true) )); }
/// <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) { }
public static Composite MoveToLineOfSight(ValueRetriever<DiaUnit> unit) { return new Decorator(ret => unit != null, CommonBehaviors.MoveToLos(unit, true) ); }
/// <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(); }
/// <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; }
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)); }
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; }
/// <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; }
/// <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); }
/// <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()); }) ); }
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; } }
/// <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); }
/// <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); }
/// <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) { }
/// <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); }
/// <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) { }
/// <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) { }
public static Composite MoveTo(ValueRetriever<Vector3> position, float range) { return CommonBehaviors.MoveAndStop(position, range, true, "Target Position"); }
/// <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) { }
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)))); }
public static Composite MoveTo(ValueRetriever <Vector3> position, float range) { return(CommonBehaviors.MoveAndStop(position, range, true, "Target Position")); }
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))))); }
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)))); }
/// <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); }
/// <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); }
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))))); }