punish v6.8.18.0
This commit is contained in:
commit
cfb4dea47e
316 changed files with 554088 additions and 0 deletions
|
@ -0,0 +1,47 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.Steps.Shared;
|
||||
|
||||
internal static class StepDisabled
|
||||
{
|
||||
internal sealed class Factory : SimpleTaskFactory
|
||||
{
|
||||
public override ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
if (!step.Disabled)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new SkipRemainingTasks();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SkipRemainingTasks : ITask
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "StepDisabled";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SkipDisabledStepsExecutor(ILogger<SkipRemainingTasks> logger) : TaskExecutor<SkipRemainingTasks>()
|
||||
{
|
||||
protected override bool Start()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override ETaskResult Update()
|
||||
{
|
||||
logger.LogInformation("Skipping step, as it is disabled");
|
||||
return ETaskResult.SkipRemainingTasksForStep;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue