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