using System.Text.Json.Serialization;

namespace Theriapolis.Core.Data;

/// <summary>
/// Definition record for a named faction, loaded from factions.json.
/// </summary>
public sealed class FactionDef
{
    /// <summary>Machine-readable id matching FactionId enum (e.g. "covenant_enforcers").</summary>
    public string Id { get; set; } = "";

    /// <summary>Display name shown in UI.</summary>
    public string Name { get; set; } = "";

    /// <summary>Abbreviated name for tight spaces.</summary>
    public string ShortName { get; set; } = "";

    /// <summary>Hex color string for map overlay (e.g. "#4455AA").</summary>
    public string Color { get; set; } = "#FFFFFF";

    /// <summary>Brief description used in tooltips/codex.</summary>
    public string Description { get; set; } = "";

    /// <summary>
    /// Phase 6 M2 — opposition multipliers per <c>reputation.md §I-2</c>.
    /// When the player gains <c>+N</c> with this faction, every entry
    /// <c>{ otherFactionId: m }</c> here applies <c>+N × m</c> to that other
    /// faction's standing. Multipliers are negative for rivals (helping
    /// Inheritors hurts you with Enforcers), positive for allies, 0 for
    /// neutrals. Asymmetry is by design — see the design doc.
    /// </summary>
    [JsonPropertyName("opposition")]
    public Dictionary<string, float> Opposition { get; set; } = new();

    /// <summary>
    /// Phase 6 M2 — when true, this faction is hidden from the reputation
    /// screen until the player learns it exists (the Maw, in Act I climax).
    /// The faction still exists internally and accumulates standing.
    /// </summary>
    [JsonPropertyName("hidden")]
    public bool Hidden { get; set; } = false;
}
