Delete the applied CommodityShapes batch

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-27 01:21:29 +01:00
commit 631653d940

View file

@ -1,19 +0,0 @@
using System.Linq;
using GameCult.Caching;
// One-shot (aetheria-living-world, cut commodity-shapes): gives every commodity stored with no Shape a one-cell Shape, put back by its
// concrete type. Writes only where Shape is null, so a rerun writes nothing. Deleted once applied.
public sealed class CommodityShapes : EconomyBatch
{
public override void Author(EconomyAuthor author)
{
var catalog = author.Catalog;
foreach (var item in catalog.GetAll<ItemData>().Where(Recipes.IsCommodity).Where(item => item.Shape == null).ToArray())
{
item.Shape = new Shape();
var key = catalog.RefOf(item).Key;
if (item is SimpleCommodityData simple) author.Put(simple, key);
else author.Put((CompoundCommodityData) item, key);
}
}
}