forked from aly/qstbak
50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
using System;
|
|
using Microsoft.Extensions.Logging;
|
|
using Questionable.Functions;
|
|
using Questionable.Model;
|
|
using Questionable.Model.Questing;
|
|
using SmartNav.Model;
|
|
|
|
namespace Questionable.Controller.Steps.Interactions;
|
|
|
|
internal static class AethernetShard
|
|
{
|
|
internal sealed class Factory : SimpleTaskFactory
|
|
{
|
|
public override ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
|
|
{
|
|
if (step.InteractionType != EInteractionType.AttuneAethernetShard)
|
|
{
|
|
return null;
|
|
}
|
|
ArgumentNullException.ThrowIfNull(step.AethernetShard, "step.AethernetShard");
|
|
return new Attune(step.AethernetShard.Value);
|
|
}
|
|
}
|
|
|
|
internal sealed record Attune(EAetheryteLocation AetheryteLocation) : ITask
|
|
{
|
|
public bool ShouldRedoOnInterrupt()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"AttuneAethernetShard({AetheryteLocation})";
|
|
}
|
|
}
|
|
|
|
internal sealed class DoAttune : Aetheryte.DoAttuneBase<Attune>
|
|
{
|
|
public DoAttune(AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, ILogger<DoAttune> logger)
|
|
: base(aetheryteFunctions, gameFunctions, (ILogger)logger, "aethernet shard")
|
|
{
|
|
}
|
|
|
|
protected override EAetheryteLocation GetLocation()
|
|
{
|
|
return base.Task.AetheryteLocation;
|
|
}
|
|
}
|
|
}
|