namespace Theriapolis.Core.Data;
///
/// Phase 6 M0 — bundle of all settlement-stamp content needed to drive
/// . Held by
/// ; passed into
/// as an optional argument so headless tools that don't need full content
/// (e.g. worldgen-dump) can run without it.
///
public sealed class SettlementContent
{
public IReadOnlyDictionary Buildings { get; }
public IReadOnlyDictionary PresetByAnchor { get; }
/// Tier 1..5 → procedural layout (or null if no procedural layout for that tier).
public IReadOnlyDictionary ProceduralByTier { get; }
public SettlementContent(
IReadOnlyDictionary buildings,
IReadOnlyDictionary presetByAnchor,
IReadOnlyDictionary proceduralByTier)
{
Buildings = buildings;
PresetByAnchor = presetByAnchor;
ProceduralByTier = proceduralByTier;
}
///
/// Look up the layout to use for a given settlement, preferring the
/// hand-authored preset for its anchor (if any) and falling back to the
/// procedural layout for its tier.
///
public SettlementLayoutDef? ResolveFor(World.Settlement settlement)
{
if (settlement.Anchor is { } anchor &&
PresetByAnchor.TryGetValue(anchor.ToString(), out var preset))
return preset;
if (ProceduralByTier.TryGetValue(settlement.Tier, out var proc))
return proc;
return null;
}
}