Describe inventory access as typed documents

This commit is contained in:
Meta Vens 2026-06-29 05:11:56 +01:00
commit 759caaaf17
3 changed files with 17 additions and 4 deletions

View file

@ -6122,6 +6122,7 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root)
{
var tradeMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "TradeMenu.cs");
var inventoryPanelPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "InventoryPanel.cs");
var inventoryMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "InventoryMenu.cs");
var catalogSnapshotPath = Path.Combine(
root,
"Packages",
@ -6142,6 +6143,10 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root)
{
throw new InvalidOperationException("Cannot verify typed catalog item enum accessors; InventoryPanel.cs is missing.");
}
if (!File.Exists(inventoryMenuPath))
{
throw new InvalidOperationException("Cannot verify typed inventory document vocabulary; InventoryMenu.cs is missing.");
}
if (!File.Exists(catalogSnapshotPath))
{
throw new InvalidOperationException("Cannot verify typed catalog item enum accessors; AetheriaRuntimeCatalogSnapshot.cs is missing.");
@ -6153,6 +6158,7 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root)
var tradeMenu = File.ReadAllText(tradeMenuPath);
var inventoryPanel = File.ReadAllText(inventoryPanelPath);
var inventoryMenu = File.ReadAllText(inventoryMenuPath);
var catalogSnapshot = File.ReadAllText(catalogSnapshotPath);
var tradeQueries = File.ReadAllText(tradeQueriesPath);
var requiredTradeMenuSymbols = new[]
@ -6229,6 +6235,13 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root)
"InventoryPanel must ask AetheriaRuntimeCatalogItem for typed hardpoint classification instead of parsing catalog strings locally.");
}
if (inventoryPanel.Contains("inventory projection", StringComparison.OrdinalIgnoreCase) ||
inventoryMenu.Contains("inventory projection", StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException(
"Inventory UI must describe direct reactive inventory document access as typed documents, not inventory projection chaff.");
}
var requiredQuerySymbols = new[]
{
"public static class AetheriaRuntimeDaemonTradeItemQueries",

View file

@ -863,7 +863,7 @@ public class InventoryMenu : MonoBehaviour
}
catch (Exception ex)
{
Debug.LogWarning($"Failed to validate Aetheria inventory projection for {entityKey}: {ex.Message}");
Debug.LogWarning($"Failed to validate Aetheria typed inventory document for {entityKey}: {ex.Message}");
return false;
}
}
@ -1008,7 +1008,7 @@ public class InventoryMenu : MonoBehaviour
}
catch (Exception ex)
{
Debug.LogWarning($"Failed to bind Aetheria inventory projection for entity {entityIndex}: {ex.Message}");
Debug.LogWarning($"Failed to bind Aetheria typed inventory document for entity {entityIndex}: {ex.Message}");
}
return _inventory?.Current;

View file

@ -1276,7 +1276,7 @@ private void Update()
}
catch (Exception ex)
{
Debug.LogWarning($"Failed to validate Aetheria inventory projection for {entityKey}: {ex.Message}");
Debug.LogWarning($"Failed to validate Aetheria typed inventory document for {entityKey}: {ex.Message}");
return false;
}
}
@ -1572,7 +1572,7 @@ private void Update()
}
catch (Exception ex)
{
Debug.LogWarning($"Failed to bind Aetheria inventory projection for entity {entityIndex}: {ex.Message}");
Debug.LogWarning($"Failed to bind Aetheria typed inventory document for entity {entityIndex}: {ex.Message}");
}
return _inventory?.Current;