master #3

Open
cacahuetes wants to merge 1006 commits from liza/Questionable:master into cacahuetes-ShB-Healer
3 changed files with 14 additions and 2 deletions
Showing only changes of commit 48cc37dd05 - Show all commits

View File

@ -473,6 +473,9 @@ internal sealed class QuestController : MiniTaskController<QuestController>
private void ClearTasksInternal()
{
//_logger.LogDebug("Clearing task (internally)");
if (_taskQueue.CurrentTaskExecutor is IStoppableTaskExecutor stoppableTaskExecutor)
stoppableTaskExecutor.StopNow();
_taskQueue.Reset();
_yesAlreadyIpc.RestoreYesAlready();

View File

@ -49,7 +49,7 @@ internal static class Duty
TerritoryData territoryData,
IClientState clientState,
IChatGui chatGui,
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>, IStoppableTaskExecutor
{
protected override bool Start()
{
@ -94,6 +94,8 @@ internal static class Duty
: ETaskResult.StillRunning;
}
public void StopNow() => autoDutyIpc.Stop();
public override bool ShouldInterruptOnDamage() => false;
}
@ -105,7 +107,7 @@ internal static class Duty
internal sealed class WaitAutoDutyExecutor(
AutoDutyIpc autoDutyIpc,
TerritoryData territoryData,
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>, IStoppableTaskExecutor
{
protected override bool Start() => true;
@ -120,6 +122,8 @@ internal static class Duty
: ETaskResult.StillRunning;
}
public void StopNow() => autoDutyIpc.Stop();
public override bool ShouldInterruptOnDamage() => false;
}

View File

@ -25,6 +25,11 @@ internal interface IExtraTaskCreator : ITaskExecutor
IEnumerable<ITask> CreateExtraTasks();
}
internal interface IStoppableTaskExecutor : ITaskExecutor
{
void StopNow();
}
internal abstract class TaskExecutor<T> : ITaskExecutor
where T : class, ITask
{