using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace RolemasterDb.App.Domain;

public static class AffixDisplayMap
{
    private static readonly IReadOnlyDictionary<string, AffixDisplayInfo> Map = new Dictionary<string, AffixDisplayInfo>(StringComparer.Ordinal)
    {
        [CriticalEffectCodes.StunnedRounds] = new(
            "Stunned",
            "🗱",
            "Cannot act for the indicated rounds.",
            "Stunned for the displayed duration."),
        [CriticalEffectCodes.MustParryRounds] = new(
            "Must Parry",
            "⚔️",
            "Forced parry for the indicated rounds.",
            "Must parry until the duration ends."),
        [CriticalEffectCodes.NoParryRounds] = new(
            "No Parry",
            "🚫",
            "Cannot parry for the indicated rounds.",
            "No parry for the displayed duration."),
        [CriticalEffectCodes.BleedPerRound] = new(
            "Bleed",
            "🩸",
            "Bleeds the displayed hits each round.",
            "Bleeds the shown hits per round."),
        [CriticalEffectCodes.DirectHits] = new(
            "Direct Hits",
            "🗡️",
            "Additional direct hits.",
            "Direct hits equal to the listed value."),
        [CriticalEffectCodes.FoePenalty] = new(
            "Foe Penalty",
            "🔻",
            "Penalty applied to the foe.",
            "Foe penalty of the displayed value."),
        [CriticalEffectCodes.AttackerBonusNextRound] = new(
            "Attacker Bonus",
            "➕",
            "Attacker bonus next round.",
            "Adds the shown bonus next round."),
        [CriticalEffectCodes.PowerPointModifier] = new(
            "Power Point Mod",
            "⚡",
            "Adjusts the foe's power points.",
            "Power-point modifier per the expression.")
    };

    public static bool TryGet(string effectCode, [NotNullWhen(true)] out AffixDisplayInfo? info) =>
        Map.TryGetValue(effectCode, out info);

    public static IReadOnlyDictionary<string, AffixDisplayInfo> Entries => Map;
}
