Delete GenerateBossLoadout, ShipLoadout and the boss fallback tests (does not build: ZoneGenerator and Program still call them until the next commit)

Boss gear is never drawn (ruling boss-gear-is-a-loadout). GenerateShipLoadout gets its single body back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-18 18:22:15 +02:00
commit bfcde46c0f
3 changed files with 6 additions and 61 deletions

View file

@ -48,13 +48,7 @@ public class LoadoutGenerator
ItemManager.Log("Unable to generate ship loadout: no compatible hull found!");
return null;
}
return ShipLoadout(hullProduct);
}
// The ship a hull product becomes: outfit, pickup, consumables, packed. Callers choose the product; this is the one build.
public EntityPack ShipLoadout(FactionProductData product)
{
var hull = ItemManager.CreateInstance(product) as EquippableItem;
var hull = ItemManager.CreateInstance(hullProduct) as EquippableItem;
if(hull==null)
ItemManager.Log("WHAT???");
var entity = new Ship(ItemManager, null, hull, ItemManager.GameplaySettings.DefaultEntitySettings);
@ -191,8 +185,8 @@ public class LoadoutGenerator
// The products this faction can be offered for a design kind (only gear needs a home), and whether manufacturer preference applies (it does
// not once a required item has fallen back to any manufacturer). The one availability rule for every selection: a Boss
// hull is never on offer, so it is never station stock, ordinary traffic, a generated scenario fit or another faction's
// fallback boss, and only BossHullsOf reaches it.
// hull is never on offer, so it is never station stock, ordinary traffic or a generated scenario fit; a Boss hull
// reaches a ship only through its faction's boss Loadout (Loadouts.BossOf).
private ((FactionProductData product, T design)[] available, bool preferManufacturers) AvailableProducts<T>(Predicate<T> filter, bool required) where T : CraftedItemData
{
var hulls = SoldHulls(ItemManager.ItemData);
@ -218,23 +212,10 @@ public class LoadoutGenerator
return (available, preferManufacturers);
}
// A faction's boss: the Boss hull it makes (BossHullsOf, dearest first), else the most expensive ordinary ship hull the
// faction can be offered, with the gap logged. Null only when no ship hull is on offer at all.
public EntityPack GenerateBossLoadout()
{
var made = BossHullsOf(ItemManager.ItemData, Faction);
if (made.Length > 0) return ShipLoadout(made[0].product);
ItemManager.Log($"{Faction?.Name ?? "This faction"} makes no boss hull; its boss flies the most expensive ship hull instead.");
var (available, _) = AvailableProducts<HullData>(hull => hull.HullType == HullType.Ship, required: true);
if (available.Length == 0) return null;
var priciest = available.OrderByDescending(entry => entry.design.Price).ThenBy(entry => entry.design.Name, StringComparer.Ordinal).First().design;
return GenerateShipLoadout(hull => hull == priciest);
}
// The one owner of which hull is a faction's boss: the Ship hulls flagged Boss among the designs of the products the
// faction manufactures, dearest first then by name. The flag lives on the hull and the maker on the product, so a Boss
// hull several makers sell is a boss of each; nothing here reads a model, a prefab or a visual.
// hull several makers sell is a boss of each; nothing here reads a model, a prefab or a visual. Its readers are
// Loadouts.BossOf and AetherDb factions.
public static (FactionProductData product, HullData hull)[] BossHullsOf(CultCache items, Faction faction) =>
faction == null
? Array.Empty<(FactionProductData, HullData)>()