Add the lot ledger and mint every crafted instance through it

Quality, Ingredients and Product leave CraftedItemInstance; a unit now
carries only a LotId into the run-scoped ProvenanceLedger. ItemManager
gains the one lot-minting path (CreateLot/CreateInstance(int)), GetLot,
and Brand(), which derives a maker and product from provenance instead
of a stored field. RunSave persists the ledger pruned to what the saved
zones' entities still reach; the live ledger is never pruned, so a
floor pickup collected after a save still resolves. CopyBuild is gone:
matching hardpoints now share the same lot instead of copying values.
PropertiesPanel shows the derived brand where the design's manufacturer
used to be. AetherDb's census flags duplicate (maker, design) products
and its save command checks every crafted instance's lot against a real
run store.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-17 04:16:23 +02:00
commit 415f8e1152
13 changed files with 305 additions and 92 deletions

View file

@ -368,8 +368,18 @@ public class PropertiesPanel : MonoBehaviour
AddProperty("Quantity", () => simpleCommodity.Quantity.ToString());
var sheet = AddStatSheet();
var manufacturer = ActionGameManager.CultCache.Get<Faction>(data.Manufacturer);
sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult");
// Branding is derived from provenance, not stored on the design; a SimpleCommodity carries no lot and shows none.
if (item is CraftedItemInstance crafted)
{
var (maker, product) = GameManager.ItemManager.Brand(crafted);
if (maker != null)
sheet.AddStat("Manufacturer", () => maker.Name);
if (product != null)
{
AddProperty(product.Name);
AddProperty(product.Description);
}
}
sheet.AddStat("Mass", () => ActionGameManager.PlayerSettings.Format(GameManager.ItemManager.GetMass(item)));
//AddProperty("Thermal Mass", () => Context.GetThermalMass(item).SignificantDigits(Context.GameplaySettings.SignificantDigits));