Index runtime catalog item lookup

This commit is contained in:
Meta Vens 2026-07-19 09:18:25 +01:00
commit ee3fb2092b
2 changed files with 47 additions and 2 deletions

View file

@ -101,6 +101,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
RunCheck(StableEntityIdentitySurvivesCrossZoneReindex);
RunCheck(TractorRampsAndPullsThroughYmirWithoutTeleportingCargo);
RunCheck(PickupProximityPrecedesYmirCollisionShell);
RunCheck(CatalogItemIndexPreservesSnapshotLookupSemantics);
RunCheck(PickupIsCapacityCheckedExactlyOnceAndExpires);
RunCheck(StationBodiesCannotConsumePickups);
RunCheck(PickupProximityCollectsOrBounces);
@ -8286,6 +8287,22 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
"a proximity-collected pickup must leave authoritative world state exactly once");
}
private static void CatalogItemIndexPreservesSnapshotLookupSemantics()
{
var first = CatalogItem("Indexed-Item");
var duplicate = CatalogItem("indexed-item");
var catalog = new AetheriaRuntimeCatalogSnapshot([first, duplicate], [], []);
Require(ReferenceEquals(first, catalog.FindItem("INDEXED-ITEM")),
"the derived catalog index must preserve first case-insensitive match semantics");
var replacement = CatalogItem("replacement-item");
catalog.Items = [replacement];
Require(catalog.FindItem("indexed-item") == null &&
ReferenceEquals(replacement, catalog.FindItem("REPLACEMENT-ITEM")),
"replacing snapshot items must invalidate the derived lookup index");
}
private static void PickupIsCapacityCheckedExactlyOnceAndExpires()
{
var hull = CatalogItem("pickup-hull"); hull.HullCapacity = PerformanceStat(1);