TimePasses/Model/WhenQuest.cs

23 lines
736 B
C#
Raw Permalink Normal View History

2024-06-17 17:25:46 +00:00
using FFXIVClientStructs.FFXIV.Client.Game;
namespace TimePasses.Model;
[Serializable]
public class WhenQuest : IWhen {
public uint Id { get; init; }
public QuestStatus Status { get; init; }
2024-06-21 15:27:36 +00:00
public ReplacementText Text { get; init; }
2024-06-17 17:25:46 +00:00
public bool Slowly { get; init; }
public unsafe bool IsValid(Plugin plugin) {
var complete = QuestManager.IsQuestComplete(this.Id);
var accepted = QuestManager.Instance()->IsQuestAccepted(this.Id);
return this.Status switch {
QuestStatus.Complete when complete => true,
QuestStatus.Incomplete when !complete => true,
QuestStatus.InProgress when accepted && !complete => true,
_ => false,
};
}
}