punish v6.8.18.0
This commit is contained in:
commit
cfb4dea47e
316 changed files with 554088 additions and 0 deletions
48
Questionable/Questionable.Model/Quest.cs
Normal file
48
Questionable/Questionable.Model/Quest.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Model;
|
||||
|
||||
internal sealed class Quest
|
||||
{
|
||||
public enum ESource
|
||||
{
|
||||
Assembly,
|
||||
ProjectDirectory,
|
||||
UserDirectory
|
||||
}
|
||||
|
||||
public required ElementId Id { get; init; }
|
||||
|
||||
public required QuestRoot Root { get; init; }
|
||||
|
||||
public required IQuestInfo Info { get; init; }
|
||||
|
||||
public required ESource Source { get; init; }
|
||||
|
||||
public QuestSequence? FindSequence(byte currentSequence)
|
||||
{
|
||||
return Root.QuestSequence.SingleOrDefault((QuestSequence seq) => seq.Sequence == currentSequence);
|
||||
}
|
||||
|
||||
public IEnumerable<QuestSequence> AllSequences()
|
||||
{
|
||||
return Root.QuestSequence;
|
||||
}
|
||||
|
||||
public IEnumerable<(QuestSequence Sequence, int StepId, QuestStep Step)> AllSteps()
|
||||
{
|
||||
foreach (QuestSequence sequence in Root.QuestSequence)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < sequence.Steps.Count)
|
||||
{
|
||||
QuestStep item = sequence.Steps[i];
|
||||
yield return (Sequence: sequence, StepId: i, Step: item);
|
||||
int num = i + 1;
|
||||
i = num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue