23 lines
727 B
C#
23 lines
727 B
C#
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
||
|
|
||
|
namespace TimePasses.Model;
|
||
|
|
||
|
[Serializable]
|
||
|
public class WhenQuest : IWhen {
|
||
|
public uint Id { get; init; }
|
||
|
public QuestStatus Status { get; init; }
|
||
|
public string Text { get; init; }
|
||
|
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,
|
||
|
};
|
||
|
}
|
||
|
}
|