Delete the applied RawStartPrices batch

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-27 02:27:02 +01:00
commit 24b000eba8

View file

@ -1,19 +0,0 @@
using System;
using GameCult.Caching;
// One-shot: gives each raw good still at Price 0 a start price, its labour at the going wage over its output count (at least 1).
// Price 0 on a raw good is unset, not free; after this the wage reads only authored raw prices, and author's reprice writes only made
// goods, which never enter the wage. Applied, then deleted.
public sealed class RawStartPrices : EconomyBatch
{
public override void Author(EconomyAuthor author)
{
var wage = EconomyBalance.Wage(author.Catalog);
foreach (var recipe in author.Catalog.GetAll<RecipeData>())
{
var item = author.Catalog.Get(recipe.Output);
if (item == null || !Recipes.IsCommodity(item) || !Recipes.IsRaw(author.Catalog, recipe) || item.Price != 0) continue;
author.SetPrice(recipe.Output.Key.Value, Math.Max(1, (int) Math.Round(wage * recipe.Workforce * recipe.Cycle / recipe.OutputCount, MidpointRounding.AwayFromZero)));
}
}
}