1
0
forked from liza/Questionable

Rename task stuff

This commit is contained in:
Liza 2024-09-19 00:00:16 +02:00
parent b85ab8afe7
commit dfd38a311b
Signed by: liza
GPG Key ID: 7199F8D727D55F67
11 changed files with 25 additions and 25 deletions

View File

@ -33,11 +33,11 @@ internal static class NextQuest
public override string ToString() => $"SetNextQuest({NextQuestId})"; public override string ToString() => $"SetNextQuest({NextQuestId})";
} }
internal sealed class Executor( internal sealed class NextQuestExecutor(
QuestRegistry questRegistry, QuestRegistry questRegistry,
QuestController questController, QuestController questController,
QuestFunctions questFunctions, QuestFunctions questFunctions,
ILogger<Executor> logger) : TaskExecutor<SetQuestTask> ILogger<NextQuestExecutor> logger) : TaskExecutor<SetQuestTask>
{ {
protected override bool Start() protected override bool Start()
{ {

View File

@ -9,7 +9,7 @@ internal static class WaitCondition
public override string ToString() => Description; public override string ToString() => Description;
} }
internal sealed class Executor : TaskExecutor<Task> internal sealed class WaitConditionExecutor : TaskExecutor<Task>
{ {
private DateTime _continueAt = DateTime.MaxValue; private DateTime _continueAt = DateTime.MaxValue;

View File

@ -29,13 +29,13 @@ internal static class DoGather
public override string ToString() => $"DoGather{(RevisitRequired ? " if revist" : "")}"; public override string ToString() => $"DoGather{(RevisitRequired ? " if revist" : "")}";
} }
internal sealed class Executor( internal sealed class GatherExecutor(
GatheringController gatheringController, GatheringController gatheringController,
GameFunctions gameFunctions, GameFunctions gameFunctions,
IGameGui gameGui, IGameGui gameGui,
IClientState clientState, IClientState clientState,
ICondition condition, ICondition condition,
ILogger<Executor> logger) : TaskExecutor<Task> ILogger<GatherExecutor> logger) : TaskExecutor<Task>
{ {
private const uint StatusGatheringRateUp = 218; private const uint StatusGatheringRateUp = 218;

View File

@ -27,12 +27,12 @@ internal static class DoGatherCollectable
$"DoGatherCollectable({SeIconChar.Collectible.ToIconString()}/{Request.Collectability}){(RevisitRequired ? " if revist" : "")}"; $"DoGatherCollectable({SeIconChar.Collectible.ToIconString()}/{Request.Collectability}){(RevisitRequired ? " if revist" : "")}";
} }
internal sealed class Executor( internal sealed class GatherCollectableExecutor(
GatheringController gatheringController, GatheringController gatheringController,
GameFunctions gameFunctions, GameFunctions gameFunctions,
IClientState clientState, IClientState clientState,
IGameGui gameGui, IGameGui gameGui,
ILogger<Executor> logger) : TaskExecutor<Task> ILogger<GatherCollectableExecutor> logger) : TaskExecutor<Task>
{ {
private Queue<EAction>? _actionQueue; private Queue<EAction>? _actionQueue;

View File

@ -21,11 +21,11 @@ internal static class MoveToLandingLocation
public override string ToString() => $"Land/{FlyBetweenNodes}"; public override string ToString() => $"Land/{FlyBetweenNodes}";
} }
internal sealed class Executor( internal sealed class MoveToLandingLocationExecutor(
MoveTo.MoveExecutor moveExecutor, MoveTo.MoveExecutor moveExecutor,
GameFunctions gameFunctions, GameFunctions gameFunctions,
IObjectTable objectTable, IObjectTable objectTable,
ILogger<Executor> logger) : TaskExecutor<Task> ILogger<MoveToLandingLocationExecutor> logger) : TaskExecutor<Task>
{ {
private ITask _moveTask = null!; private ITask _moveTask = null!;

View File

@ -26,7 +26,7 @@ internal static class Duty
public override string ToString() => $"OpenDutyFinder({ContentFinderConditionId})"; public override string ToString() => $"OpenDutyFinder({ContentFinderConditionId})";
} }
internal sealed class Executor( internal sealed class OpenDutyWindowExecutor(
GameFunctions gameFunctions, GameFunctions gameFunctions,
ICondition condition) : TaskExecutor<Task> ICondition condition) : TaskExecutor<Task>
{ {

View File

@ -33,9 +33,9 @@ internal static class EquipItem
public override string ToString() => $"Equip({ItemId})"; public override string ToString() => $"Equip({ItemId})";
} }
internal sealed class Executor( internal sealed class DoEquip(
IDataManager dataManager, IDataManager dataManager,
ILogger<Executor> logger) : TaskExecutor<Task>, IToastAware ILogger<DoEquip> logger) : TaskExecutor<Task>, IToastAware
{ {
private const int MaxAttempts = 3; private const int MaxAttempts = 3;

View File

@ -22,7 +22,7 @@ internal static class StepDisabled
public override string ToString() => "StepDisabled"; public override string ToString() => "StepDisabled";
} }
internal sealed class Executor(ILogger<SkipRemainingTasks> logger) : TaskExecutor<SkipRemainingTasks> internal sealed class SkipDisabledStepsExecutor(ILogger<SkipRemainingTasks> logger) : TaskExecutor<SkipRemainingTasks>
{ {
protected override bool Start() => true; protected override bool Start() => true;

View File

@ -13,7 +13,7 @@ internal static class SwitchClassJob
public override string ToString() => $"SwitchJob({ClassJob})"; public override string ToString() => $"SwitchJob({ClassJob})";
} }
internal sealed class Executor(IClientState clientState) : AbstractDelayedTaskExecutor<Task> internal sealed class SwitchClassJobExecutor(IClientState clientState) : AbstractDelayedTaskExecutor<Task>
{ {
protected override unsafe bool StartInternal() protected override unsafe bool StartInternal()
{ {

View File

@ -63,7 +63,7 @@ internal static class QuestWorkUtils
{ {
if (requiredQuestVariables.Count != 6 || requiredQuestVariables.All(x => x == null || x.Count == 0)) if (requiredQuestVariables.Count != 6 || requiredQuestVariables.All(x => x == null || x.Count == 0))
{ {
logger.LogDebug("No RQW defined"); logger.LogDebug("No RequiredQW defined");
return true; return true;
} }
@ -71,7 +71,7 @@ internal static class QuestWorkUtils
{ {
if (requiredQuestVariables[i] == null) if (requiredQuestVariables[i] == null)
{ {
logger.LogInformation("No RQW {Index} defined", i); logger.LogDebug("No RequiredQW {Index} defined", i);
continue; continue;
} }

View File

@ -129,16 +129,16 @@ public sealed class QuestionablePlugin : IDalamudPlugin
private static void AddTaskFactories(ServiceCollection serviceCollection) private static void AddTaskFactories(ServiceCollection serviceCollection)
{ {
// individual tasks // individual tasks
serviceCollection.AddTaskExecutor<MoveToLandingLocation.Task, MoveToLandingLocation.Executor>(); serviceCollection.AddTaskExecutor<MoveToLandingLocation.Task, MoveToLandingLocation.MoveToLandingLocationExecutor>();
serviceCollection.AddTaskExecutor<DoGather.Task, DoGather.Executor>(); serviceCollection.AddTaskExecutor<DoGather.Task, DoGather.GatherExecutor>();
serviceCollection.AddTaskExecutor<DoGatherCollectable.Task, DoGatherCollectable.Executor>(); serviceCollection.AddTaskExecutor<DoGatherCollectable.Task, DoGatherCollectable.GatherCollectableExecutor>();
serviceCollection.AddTaskExecutor<SwitchClassJob.Task, SwitchClassJob.Executor>(); serviceCollection.AddTaskExecutor<SwitchClassJob.Task, SwitchClassJob.SwitchClassJobExecutor>();
serviceCollection.AddTaskExecutor<Mount.MountTask, Mount.MountExecutor>(); serviceCollection.AddTaskExecutor<Mount.MountTask, Mount.MountExecutor>();
serviceCollection.AddTaskExecutor<Mount.UnmountTask, Mount.UnmountExecutor>(); serviceCollection.AddTaskExecutor<Mount.UnmountTask, Mount.UnmountExecutor>();
// task factories // task factories
serviceCollection serviceCollection
.AddTaskFactoryAndExecutor<StepDisabled.SkipRemainingTasks, StepDisabled.Factory, StepDisabled.Executor>(); .AddTaskFactoryAndExecutor<StepDisabled.SkipRemainingTasks, StepDisabled.Factory, StepDisabled.SkipDisabledStepsExecutor>();
serviceCollection.AddTaskFactory<EquipRecommended.BeforeDutyOrInstance>(); serviceCollection.AddTaskFactory<EquipRecommended.BeforeDutyOrInstance>();
serviceCollection.AddTaskFactoryAndExecutor<Gather.GatheringTask, Gather.Factory, Gather.StartGathering>(); serviceCollection.AddTaskFactoryAndExecutor<Gather.GatheringTask, Gather.Factory, Gather.StartGathering>();
serviceCollection.AddTaskExecutor<Gather.SkipMarker, Gather.DoSkip>(); serviceCollection.AddTaskExecutor<Gather.SkipMarker, Gather.DoSkip>();
@ -156,14 +156,14 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceCollection.AddTaskExecutor<MoveTo.WaitForNearDataId, MoveTo.WaitForNearDataIdExecutor>(); serviceCollection.AddTaskExecutor<MoveTo.WaitForNearDataId, MoveTo.WaitForNearDataIdExecutor>();
serviceCollection.AddTaskExecutor<MoveTo.LandTask, MoveTo.LandExecutor>(); serviceCollection.AddTaskExecutor<MoveTo.LandTask, MoveTo.LandExecutor>();
serviceCollection.AddTaskFactoryAndExecutor<NextQuest.SetQuestTask, NextQuest.Factory, NextQuest.Executor>(); serviceCollection.AddTaskFactoryAndExecutor<NextQuest.SetQuestTask, NextQuest.Factory, NextQuest.NextQuestExecutor>();
serviceCollection serviceCollection
.AddTaskFactoryAndExecutor<AetherCurrent.Attune, AetherCurrent.Factory, AetherCurrent.DoAttune>(); .AddTaskFactoryAndExecutor<AetherCurrent.Attune, AetherCurrent.Factory, AetherCurrent.DoAttune>();
serviceCollection serviceCollection
.AddTaskFactoryAndExecutor<AethernetShard.Attune, AethernetShard.Factory, AethernetShard.DoAttune>(); .AddTaskFactoryAndExecutor<AethernetShard.Attune, AethernetShard.Factory, AethernetShard.DoAttune>();
serviceCollection.AddTaskFactoryAndExecutor<Aetheryte.Attune, Aetheryte.Factory, Aetheryte.DoAttune>(); serviceCollection.AddTaskFactoryAndExecutor<Aetheryte.Attune, Aetheryte.Factory, Aetheryte.DoAttune>();
serviceCollection.AddTaskFactoryAndExecutor<Combat.Task, Combat.Factory, Combat.HandleCombat>(); serviceCollection.AddTaskFactoryAndExecutor<Combat.Task, Combat.Factory, Combat.HandleCombat>();
serviceCollection.AddTaskFactoryAndExecutor<Duty.Task, Duty.Factory, Duty.Executor>(); serviceCollection.AddTaskFactoryAndExecutor<Duty.Task, Duty.Factory, Duty.OpenDutyWindowExecutor>();
serviceCollection.AddTaskFactory<Emote.Factory>(); serviceCollection.AddTaskFactory<Emote.Factory>();
serviceCollection.AddTaskExecutor<Emote.UseOnObject, Emote.UseOnObjectExecutor>(); serviceCollection.AddTaskExecutor<Emote.UseOnObject, Emote.UseOnObjectExecutor>();
serviceCollection.AddTaskExecutor<Emote.UseOnSelf, Emote.UseOnSelfExecutor>(); serviceCollection.AddTaskExecutor<Emote.UseOnSelf, Emote.UseOnSelfExecutor>();
@ -179,7 +179,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceCollection.AddTaskExecutor<UseItem.UseOnPosition, UseItem.UseOnPositionExecutor>(); serviceCollection.AddTaskExecutor<UseItem.UseOnPosition, UseItem.UseOnPositionExecutor>();
serviceCollection.AddTaskExecutor<UseItem.UseOnObject, UseItem.UseOnObjectExecutor>(); serviceCollection.AddTaskExecutor<UseItem.UseOnObject, UseItem.UseOnObjectExecutor>();
serviceCollection.AddTaskExecutor<UseItem.UseOnSelf, UseItem.UseOnSelfExecutor>(); serviceCollection.AddTaskExecutor<UseItem.UseOnSelf, UseItem.UseOnSelfExecutor>();
serviceCollection.AddTaskFactoryAndExecutor<EquipItem.Task, EquipItem.Factory, EquipItem.Executor>(); serviceCollection.AddTaskFactoryAndExecutor<EquipItem.Task, EquipItem.Factory, EquipItem.DoEquip>();
serviceCollection serviceCollection
.AddTaskFactoryAndExecutor<EquipRecommended.EquipTask, EquipRecommended.Factory, .AddTaskFactoryAndExecutor<EquipRecommended.EquipTask, EquipRecommended.Factory,
EquipRecommended.DoEquipRecommended>(); EquipRecommended.DoEquipRecommended>();
@ -194,7 +194,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceCollection.AddTaskExecutor<InitiateLeve.Initiate, InitiateLeve.InitiateExecutor>(); serviceCollection.AddTaskExecutor<InitiateLeve.Initiate, InitiateLeve.InitiateExecutor>();
serviceCollection.AddTaskExecutor<InitiateLeve.SelectDifficulty, InitiateLeve.SelectDifficultyExecutor>(); serviceCollection.AddTaskExecutor<InitiateLeve.SelectDifficulty, InitiateLeve.SelectDifficultyExecutor>();
serviceCollection.AddTaskExecutor<WaitCondition.Task, WaitCondition.Executor>(); serviceCollection.AddTaskExecutor<WaitCondition.Task, WaitCondition.WaitConditionExecutor>();
serviceCollection.AddTaskFactory<WaitAtEnd.Factory>(); serviceCollection.AddTaskFactory<WaitAtEnd.Factory>();
serviceCollection.AddTaskExecutor<WaitAtEnd.WaitDelay, WaitAtEnd.WaitDelayExecutor>(); serviceCollection.AddTaskExecutor<WaitAtEnd.WaitDelay, WaitAtEnd.WaitDelayExecutor>();
serviceCollection.AddTaskExecutor<WaitAtEnd.WaitNextStepOrSequence, WaitAtEnd.WaitNextStepOrSequenceExecutor>(); serviceCollection.AddTaskExecutor<WaitAtEnd.WaitNextStepOrSequence, WaitAtEnd.WaitNextStepOrSequenceExecutor>();