namespace NeonSprawl.Server.Game.Mastery; /// Read model for one player's perk state (NEO-47). public sealed class PerkStateSnapshot { public static PerkStateSnapshot Empty { get; } = new( new Dictionary>(StringComparer.Ordinal), new HashSet(StringComparer.Ordinal)); public PerkStateSnapshot( IReadOnlyDictionary> branchPicksBySkillId, IReadOnlySet unlockedPerkIds) { BranchPicksBySkillId = branchPicksBySkillId; UnlockedPerkIds = unlockedPerkIds; } /// skillIdtierIndexbranchId. public IReadOnlyDictionary> BranchPicksBySkillId { get; } public IReadOnlySet UnlockedPerkIds { get; } public bool TryGetBranchPick(string skillId, int tierIndex, out string branchId) { branchId = string.Empty; if (!BranchPicksBySkillId.TryGetValue(skillId, out var tiers)) { return false; } return tiers.TryGetValue(tierIndex, out branchId!); } }