Boss_carries_exactly: the open slot's brand is an available product of its design (a weighted draw need not reach every one)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-18 19:08:22 +02:00
commit a74de35c82

View file

@ -186,9 +186,9 @@ public sealed partial class RunStartTests
string Cell(LoadoutSlot slot, string brand) => $"{slot.Position.x},{slot.Position.y},{slot.Rotation},{_cache.Get(slot.Design).Name},{brand}";
var pinned = loadout.Slots.Where(slot => slot != open).Select(slot => Cell(slot, _cache.Get(slot.Product).Name)).OrderBy(x => x, StringComparer.Ordinal).ToArray();
// The brands the context can choose for it: what the antagonist's own outfitter picks over many draws, never by key order.
var brands = Enumerable.Range(1, 64).Select(seed => GeneratorFor(galaxy, _items, antagonist, (uint) seed).ChooseProduct(_cache.Get(open.Design))?.Name)
.Where(name => name != null).Distinct().ToArray();
// The brands the context can choose for it: the products of the design the antagonist's outfitter can get, never any maker's.
var outfitter = GeneratorFor(galaxy, _items, antagonist, 1);
var brands = _cache.GetAll<FactionProductData>().Where(product => product.Design.Key.Equals(open.Design.Key) && outfitter.IsAvailable(product)).Select(product => product.Name).ToArray();
Assert.NotEmpty(brands);
var items = LoggingItems(new List<string>());