2024-07-25 02:15:44 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2024-07-16 08:54:47 +00:00
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-07-17 10:58:08 +00:00
|
|
|
|
using System.IO;
|
2024-08-02 16:30:21 +00:00
|
|
|
|
using Questionable.Model.Questing;
|
2024-06-01 20:01:50 +00:00
|
|
|
|
|
|
|
|
|
namespace Questionable.QuestPaths;
|
|
|
|
|
|
2024-07-16 08:54:47 +00:00
|
|
|
|
[SuppressMessage("ReSharper", "PartialTypeWithSinglePart", Justification = "Required for RELEASE")]
|
2024-06-14 09:37:33 +00:00
|
|
|
|
public static partial class AssemblyQuestLoader
|
2024-06-01 20:01:50 +00:00
|
|
|
|
{
|
2024-08-05 05:51:34 +00:00
|
|
|
|
private static Dictionary<ElementId, QuestRoot>? _quests;
|
2024-07-25 02:15:44 +00:00
|
|
|
|
|
2024-08-05 05:51:34 +00:00
|
|
|
|
public static IReadOnlyDictionary<ElementId, QuestRoot> GetQuests()
|
2024-07-25 02:15:44 +00:00
|
|
|
|
{
|
|
|
|
|
if (_quests == null)
|
|
|
|
|
{
|
|
|
|
|
_quests = [];
|
2024-07-15 01:05:37 +00:00
|
|
|
|
#if RELEASE
|
2024-07-25 02:15:44 +00:00
|
|
|
|
LoadQuests();
|
2024-06-03 12:20:02 +00:00
|
|
|
|
#endif
|
2024-07-25 02:15:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _quests ?? throw new InvalidOperationException("quest data is not initialized");
|
|
|
|
|
}
|
2024-07-17 10:58:08 +00:00
|
|
|
|
|
|
|
|
|
public static Stream QuestSchema =>
|
|
|
|
|
typeof(AssemblyQuestLoader).Assembly.GetManifestResourceStream("Questionable.QuestPaths.QuestSchema")!;
|
2024-07-25 02:15:44 +00:00
|
|
|
|
|
2024-08-01 01:22:01 +00:00
|
|
|
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
2024-08-05 05:51:34 +00:00
|
|
|
|
private static void AddQuest(ElementId questId, QuestRoot root) => _quests![questId] = root;
|
2024-07-15 01:05:37 +00:00
|
|
|
|
}
|