Expose runtime catalog relationships as typed keys

This commit is contained in:
Meta Vens 2026-06-16 12:59:33 +01:00
commit 52391b592a
9 changed files with 72 additions and 57 deletions

View file

@ -121,7 +121,7 @@ if (!catalog.FindItemsByHardpoint(equipment.HardpointType).Any())
throw new InvalidOperationException($"Runtime catalog hardpoint lookup failed for {equipment.HardpointType}.");
}
var manufactured = catalog.Items.FirstOrDefault(item => !string.IsNullOrWhiteSpace(item.ManufacturerLegacyId))
var manufactured = catalog.Items.FirstOrDefault(item => !string.IsNullOrWhiteSpace(item.ManufacturerKey))
?? throw new InvalidOperationException("Runtime catalog has no manufactured item.");
if (string.IsNullOrWhiteSpace(manufactured.ManufacturerKey) ||
catalog.FindCorporation(manufactured.ManufacturerKey) == null ||
@ -130,7 +130,7 @@ if (string.IsNullOrWhiteSpace(manufactured.ManufacturerKey) ||
throw new InvalidOperationException($"Runtime catalog typed manufacturer lookup failed for {manufactured.Name}.");
}
var packageCorporation = packageCatalog.Corporations.FirstOrDefault(corporation => !string.IsNullOrWhiteSpace(corporation.GeonameFileLegacyId));
var packageCorporation = packageCatalog.Corporations.FirstOrDefault(corporation => !string.IsNullOrWhiteSpace(corporation.GeonameFileKey));
if (packageCorporation == null)
{
throw new InvalidOperationException("Package catalog store did not read any corporation name-file links.");