A standing order carries only goods its To station's installed recipes consume

Seeding read Drawable, which included the crew's table and every draw of every recipe; it now reads Consumed (recipe draws only, startable
or not). A crew-only good has no seeded leg; a hauler can no longer be handed a good no recipe at its To takes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-30 00:25:17 +01:00
commit d267a2d2b4
3 changed files with 12 additions and 11 deletions

View file

@ -42,7 +42,7 @@ public static class RegionLegs
foreach (var (zone, station, makes) in stations)
{
if (station.Faction == null) continue;
foreach (var good in StationWants.Drawable(station).Where(good => !makes.Contains(good)).OrderBy(good => good.Value, StringComparer.Ordinal))
foreach (var good in StationWants.Consumed(station).Where(good => !makes.Contains(good)).OrderBy(good => good.Value, StringComparer.Ordinal))
{
// The nearest producer of its own faction by jumps, then zone index, then entity order (the list's order: the first
// of equals wins).

View file

@ -80,20 +80,20 @@ public static class StationWants
}
}
private static HashSet<CultRecordKey> Drawn(Entity station) => Draws(station, startableOnly: true);
// Every good the station may draw: what its installed recipe facilities draw, startable or not (what a seeded haul leg may bring it, which
// does not wait for room), and what its crew eats. The one reader of what gear could use; Drawn is the startable part.
public static IReadOnlyCollection<CultRecordKey> Drawable(Entity station) => Draws(station, startableOnly: false);
// Every good the station's installed recipe facilities consume, startable or not: what a standing haul order may carry to it (a
// seeded leg waits on room and never writes an order for a good no installed recipe takes). The crew's table is not here: it is
// bought by sale, never hauled by a seeded leg. Drawn is the startable part.
public static IReadOnlyCollection<CultRecordKey> Consumed(Entity station) =>
FacilityRecipes(station).SelectMany(recipe => Production.Draws(station.ItemManager.ItemData, recipe)).ToHashSet();
// The goods its installed recipe facilities make: the set Allocation builds.
public static IReadOnlyCollection<CultRecordKey> Makes(Entity station) => FacilityRecipes(station).Select(recipe => recipe.Output.Key).ToHashSet();
private static HashSet<CultRecordKey> Draws(Entity station, bool startableOnly)
private static HashSet<CultRecordKey> Drawn(Entity station)
{
var catalog = station.ItemManager.ItemData;
var wants = new HashSet<CultRecordKey>();
foreach (var recipe in FacilityRecipes(station).Where(recipe => !startableOnly || CanStart(station, recipe)))
foreach (var recipe in FacilityRecipes(station).Where(recipe => CanStart(station, recipe)))
foreach (var draw in Production.Draws(catalog, recipe))
wants.Add(draw);
// What its crew eats: the table of every habitation unit that runs (the module defines what and how much it consumes).