33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Diagnostics.CodeAnalysis;
|
|||
|
using System.IO;
|
|||
|
using Questionable.Model.Gathering;
|
|||
|
|
|||
|
namespace Questionable.GatheringPaths;
|
|||
|
|
|||
|
[SuppressMessage("ReSharper", "PartialTypeWithSinglePart", Justification = "Required for RELEASE")]
|
|||
|
public static partial class AssemblyGatheringLocationLoader
|
|||
|
{
|
|||
|
private static Dictionary<ushort, GatheringRoot>? _locations;
|
|||
|
|
|||
|
public static IReadOnlyDictionary<ushort, GatheringRoot> GetLocations()
|
|||
|
{
|
|||
|
if (_locations == null)
|
|||
|
{
|
|||
|
_locations = [];
|
|||
|
#if RELEASE
|
|||
|
LoadLocations();
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
return _locations ?? throw new InvalidOperationException("quest data is not initialized");
|
|||
|
}
|
|||
|
|
|||
|
public static Stream QuestSchema =>
|
|||
|
typeof(AssemblyGatheringLocationLoader).Assembly.GetManifestResourceStream("Questionable.GatheringPaths.GatheringLocationSchema")!;
|
|||
|
|
|||
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
|||
|
private static void AddLocation(ushort questId, GatheringRoot root) => _locations![questId] = root;
|
|||
|
}
|