b451f83174
Captures the pre-Godot-port state of the codebase. This is the rollback anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md). All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
30 lines
926 B
C#
30 lines
926 B
C#
namespace Theriapolis.Core.Rules.Character;
|
|
|
|
/// <summary>
|
|
/// Whose side an actor is on at the moment. Drives encounter-trigger logic:
|
|
/// hostile → auto-trigger combat on LOS; friendly/neutral → "[F] Talk to ..."
|
|
/// prompt. Phase 5 sets this from <see cref="Data.NpcTemplateDef.DefaultAllegiance"/>;
|
|
/// faction logic in Phase 6 may mutate it at runtime.
|
|
/// </summary>
|
|
public enum Allegiance : byte
|
|
{
|
|
Player = 0,
|
|
Allied = 1,
|
|
Neutral = 2,
|
|
Friendly = 3,
|
|
Hostile = 4,
|
|
}
|
|
|
|
public static class AllegianceExtensions
|
|
{
|
|
public static Allegiance FromJson(string raw) => raw.ToLowerInvariant() switch
|
|
{
|
|
"player" => Allegiance.Player,
|
|
"allied" => Allegiance.Allied,
|
|
"neutral" => Allegiance.Neutral,
|
|
"friendly" => Allegiance.Friendly,
|
|
"hostile" => Allegiance.Hostile,
|
|
_ => throw new ArgumentException($"Unknown allegiance: '{raw}'"),
|
|
};
|
|
}
|