using System;
using System.Collections.Generic;
namespace IslaApocalypse.Core
{
///
/// ⭐ THE TRANSFORMATION / RECIPE SEAM — the bridge between the two material schemas.
/// → `Design - Data - Material Schema.md` §3, D-054.
///
/// Terrain materials are RESOURCES that refine and combine into BUILDING materials —
/// e.g. sand + clay + rock → concrete. That relationship is the survival loop, and keeping the
/// two schemas distinct with a transformation between them is what stops it collapsing into
/// "the same material tagged differently".
///
/// ⚠⚠ THIS REGISTRY IS DELIBERATELY EMPTY, AND THAT IS THE POINT.
///
/// The recipes themselves are DEFERRED. Designing the resource tree now would be a
/// biomes-premature-style over-commitment — the exact mistake the rewrite exists to undo.
/// But the SEAM EXISTS NOW: the architecture has the hole, so filling it later is new ROWS and
/// never a rewrite.
///
/// Do not add recipes here without a design decision that says the tree is ready.
///
public static class RecipeRegistry
{
private static readonly List _recipes = new();
// ===== NO SEED ROWS. See the class comment — the emptiness is the design. =====
/// Append a recipe. Append-only, same as the material registries.
public static void Register(Recipe recipe)
{
if (recipe == null) throw new ArgumentNullException(nameof(recipe));
_recipes.Add(recipe);
}
public static IReadOnlyList All => _recipes;
public static int Count => _recipes.Count;
}
///
/// One transformation: some quantity of terrain-derived inputs produces a building material.
///
/// ⚠ SHAPE ONLY. The exact recipe FORMAT is an open note in the design doc — inputs may grow
/// tools, stations, time or byproducts. This is the minimum that makes the seam real enough to
/// compile against, not a committed format.
///
public sealed class Recipe
{
/// Input material keys and their amounts. Terrain-derived resources.
public IReadOnlyList Inputs { get; }
/// The building material produced.
public MaterialKey Output { get; }
/// How much of one application yields.
public int OutputAmount { get; }
public Recipe(IReadOnlyList inputs, MaterialKey output, int outputAmount)
{
Inputs = inputs ?? throw new ArgumentNullException(nameof(inputs));
Output = output;
OutputAmount = outputAmount;
}
}
/// One input line of a .
public readonly struct RecipeInput
{
public readonly MaterialKey Material;
public readonly int Amount;
public RecipeInput(MaterialKey material, int amount)
{
Material = material;
Amount = amount;
}
}
}