29 lines
567 B
C#
29 lines
567 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Questionable.Model.Questing;
|
|
|
|
public sealed class QuestSequence
|
|
{
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
public byte Sequence { get; set; }
|
|
|
|
public string? Comment { get; set; }
|
|
|
|
public List<QuestStep> Steps { get; set; } = new List<QuestStep>();
|
|
|
|
public QuestStep? FindStep(int step)
|
|
{
|
|
if (step < 0 || step >= Steps.Count)
|
|
{
|
|
return null;
|
|
}
|
|
return Steps[step];
|
|
}
|
|
|
|
public QuestStep? LastStep()
|
|
{
|
|
return Steps.LastOrDefault();
|
|
}
|
|
}
|