namespace Theriapolis.Core.Rules.Quests;

/// <summary>
/// Phase 6 M4 — runtime per-quest state. One instance per active or
/// completed quest. The <see cref="QuestEngine"/> looks up the parent
/// <see cref="Data.QuestDef"/> by id when ticking, so this struct stays
/// small and serialises cleanly into the save layer.
/// </summary>
public sealed class QuestState
{
    public string         QuestId      { get; init; } = "";
    public string         CurrentStep  { get; set; } = "";
    public QuestStatus    Status       { get; set; } = QuestStatus.Active;

    /// <summary>WorldClock seconds when the quest started.</summary>
    public long           StartedAt    { get; set; }

    /// <summary>WorldClock seconds when the current step entered.</summary>
    public long           StepStartedAt { get; set; }

    /// <summary>Free-form journal entries the player can browse from QuestLog.</summary>
    public List<string>   Journal      { get; } = new();
}

public enum QuestStatus : byte
{
    Active    = 0,
    Completed = 1,
    Failed    = 2,
}
