using System.Collections.Generic;
using Cthangover.Core.Mods;
namespace Cthangover.Mods.Rpg
{
/// Access to the merged map events of .
public static class RpgMapEvents
{
/// The events of a map (an empty list when it has none); the list is shared, do not change it.
public static IReadOnlyList Of(string map)
{
var maps = ModManager.Instance.GetResolver()?.Collect();
return map != null && maps != null && maps.TryGetValue(map, out var list) ? list : new List();
}
/// Forgets the collected events, so the next reads the files again (after an editor save).
public static void Invalidate() => ModManager.Instance.GetResolver()?.ClearCache();
}
}