68 lines
2.4 KiB
C#
68 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace IdleSpectator;
|
|
|
|
/// <summary>Authored interest overlay for every live era_library asset.</summary>
|
|
public static class EraInterestCatalog
|
|
{
|
|
private static readonly Dictionary<string, DiscreteEventEntry> Entries =
|
|
new Dictionary<string, DiscreteEventEntry>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
static EraInterestCatalog()
|
|
{
|
|
Add("age_hope", 78f, "World", InterestOwnership.Signal, "Age of Hope");
|
|
Add("age_sun", 80f, "World", InterestOwnership.Signal, "Age of Sun");
|
|
Add("age_dark", 88f, "World", InterestOwnership.Signal, "Age of Dark");
|
|
Add("age_tears", 86f, "World", InterestOwnership.Signal, "Age of Tears");
|
|
Add("age_moon", 82f, "World", InterestOwnership.Signal, "Age of Moon");
|
|
Add("age_chaos", 92f, "World", InterestOwnership.Signal, "Age of Chaos");
|
|
Add("age_wonders", 84f, "World", InterestOwnership.Signal, "Age of Wonders");
|
|
Add("age_ice", 87f, "World", InterestOwnership.Signal, "Age of Ice");
|
|
Add("age_ash", 90f, "World", InterestOwnership.Signal, "Age of Ash");
|
|
Add("age_despair", 91f, "World", InterestOwnership.Signal, "Age of Despair");
|
|
Add("age_unknown", 70f, "World", InterestOwnership.Ambient, "Unknown age");
|
|
}
|
|
|
|
private static void Add(
|
|
string id,
|
|
float strength,
|
|
string category,
|
|
InterestOwnership owns,
|
|
string label)
|
|
{
|
|
Entries[id] = new DiscreteEventEntry
|
|
{
|
|
Id = id,
|
|
EventStrength = strength,
|
|
Category = category,
|
|
OwnsCamera = owns,
|
|
CreatesInterest = true,
|
|
LabelTemplate = label
|
|
};
|
|
}
|
|
|
|
public static IEnumerable<string> AuthoredIds => Entries.Keys;
|
|
|
|
public static bool HasAuthored(string id) =>
|
|
!string.IsNullOrEmpty(id) && Entries.ContainsKey(id.Trim());
|
|
|
|
public static DiscreteEventEntry GetOrFallback(string id)
|
|
{
|
|
if (!string.IsNullOrEmpty(id) && Entries.TryGetValue(id.Trim(), out DiscreteEventEntry entry))
|
|
{
|
|
return entry;
|
|
}
|
|
|
|
string key = string.IsNullOrEmpty(id) ? "unknown" : id.Trim();
|
|
return new DiscreteEventEntry
|
|
{
|
|
Id = key,
|
|
EventStrength = 70f,
|
|
Category = "World",
|
|
OwnsCamera = InterestOwnership.Signal,
|
|
LabelTemplate = "Era ({id})",
|
|
IsFallback = true
|
|
};
|
|
}
|
|
}
|