AetherDb: mining and volatiles descriptions name Diamond and Ammonia; the ExtractionKindDescriptions batch restates them
Every commodity a kind extracts (a recipe with no inputs) is named in that kind's description: checked over the shipped catalog, only these two kinds broke it. The batch applies in the catalog commit that follows; until then the catalog tests for it fail. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1013e2a2e4
commit
ac45a5c836
3 changed files with 66 additions and 2 deletions
24
tools/AetherDb/Economy/ExtractionKindDescriptions.cs
Normal file
24
tools/AetherDb/Economy/ExtractionKindDescriptions.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using GameCult.Caching;
|
||||
|
||||
// Economy content, batch 1c: the mining and volatiles station-kind descriptions name every good their kind now extracts.
|
||||
// MunitionsFeed gave mining a Diamond recipe and volatiles an Ammonia recipe; the descriptions the station-round bench
|
||||
// wrote predate them. The same text is StationKindsCatalog.Table's, so a catalog authored fresh says the same thing.
|
||||
// Sets the description whatever it was, so a rerun converges.
|
||||
public sealed class ExtractionKindDescriptions : EconomyBatch
|
||||
{
|
||||
public override void Author(EconomyAuthor author)
|
||||
{
|
||||
foreach (var (id, description) in new[]
|
||||
{
|
||||
("mining", StationKindsCatalog.DescriptionOf("mining")),
|
||||
("volatiles", StationKindsCatalog.DescriptionOf("volatiles")),
|
||||
})
|
||||
{
|
||||
var key = StationKindData.KeyOf(id);
|
||||
var kind = author.Catalog.Get<StationKindData>(key) ?? throw new InvalidOperationException($"The catalog holds no station kind '{id}'.");
|
||||
kind.Description = description;
|
||||
author.Put(kind, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,8 +14,8 @@ public static class StationKindsCatalog
|
|||
|
||||
private static readonly (string id, string name, string description)[] Table =
|
||||
{
|
||||
("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Uranium, Potassium) from bodies and belts; consumes tools and food."),
|
||||
("volatiles", "Volatiles Station", "Skims Hydrogen, Methane and Water from gas giants and ice; consumes tools."),
|
||||
("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Uranium, Potassium) and Diamond from bodies and belts; consumes tools and food."),
|
||||
("volatiles", "Volatiles Station", "Skims Hydrogen, Methane, Ammonia and Water from gas giants and ice; consumes tools."),
|
||||
("agriculture", "Agriculture Station", "Grows Organics (Algae, Fungi, Bacteria, Animal Products) from Water and Potassium; feeds residential."),
|
||||
("processing", "Processing Station", "Refines ore and volatiles into Metals, Alloys and Compounds."),
|
||||
("fabrication", "Fabrication Station", "Turns Alloys and Compounds into Manufacturing compounds, Assemblies, gear, Ammo and consumer goods."),
|
||||
|
|
@ -33,6 +33,9 @@ public static class StationKindsCatalog
|
|||
("waystation", "Waystation", "Fuel, repair and medicine along a corridor."),
|
||||
};
|
||||
|
||||
// A kind's authored description: the one text a fresh catalog gets and an economy batch restates.
|
||||
public static string DescriptionOf(string id) => Table.Single(row => row.id == id).description;
|
||||
|
||||
public static int Run(CultCache cache, bool apply, TextWriter output)
|
||||
{
|
||||
var held = cache.GetAll<StationKindData>().Select(kind => cache.RefOf(kind).Key.Value).ToHashSet(StringComparer.Ordinal);
|
||||
|
|
|
|||
Loading…
Reference in a new issue