Files
ZeroSpace/ZeroSpace/ZeroSpace.MapEditor/Models/FactionMode.cs
T
2026-09-28 20:19:26 -04:00

47 lines
1.5 KiB
C#

using ZeroSpace.Model;
namespace ZeroSpace.MapEditor.Models;
public enum FactionMode
{
None,
EdenAccord, // Hotkey A - #10b981
KeeperCouncil, // Hotkey S - #38bdf8
ObsidianOrder // Hotkey D - #ef4444
}
public static class FactionModeExtensions
{
public static string ToOwnerName(this FactionMode mode) => mode switch
{
FactionMode.EdenAccord => StarSystemOwners.EdenAccord,
FactionMode.KeeperCouncil => StarSystemOwners.KeeperCouncil,
FactionMode.ObsidianOrder => StarSystemOwners.ObsidianOrder,
_ => string.Empty
};
public static string ToDisplayName(this FactionMode mode) => mode switch
{
FactionMode.EdenAccord => "Eden Accord",
FactionMode.KeeperCouncil => "Keeper Council",
FactionMode.ObsidianOrder => "Obsidian Order",
_ => "None"
};
public static string GetColorHex(this FactionMode mode) => mode switch
{
FactionMode.EdenAccord => StarSystemOwners.GetColor(StarSystemOwners.EdenAccord),
FactionMode.KeeperCouncil => StarSystemOwners.GetColor(StarSystemOwners.KeeperCouncil),
FactionMode.ObsidianOrder => StarSystemOwners.GetColor(StarSystemOwners.ObsidianOrder),
_ => "#94a3b8"
};
public static FactionMode FromOwnerName(string? owner) => owner switch
{
StarSystemOwners.EdenAccord => FactionMode.EdenAccord,
StarSystemOwners.KeeperCouncil => FactionMode.KeeperCouncil,
StarSystemOwners.ObsidianOrder => FactionMode.ObsidianOrder,
_ => FactionMode.None
};
}