diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 7fa34ad75..f94de5d1b 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 0bd6b6067..205a5e202 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -89,8 +89,9 @@ facade. `ItemInstance.ItemKey` is the identity surface; the old `ItemId` legacy-GUID projection has been deleted from item instances. Cargo inventory indexes, consumable activation lookup, action-bar consumable quantity/fill, transfer lookup, trade owned counts, weapon ammo references, and -item-use behavior references now use item keys. The old derived behavior -`AmmoType`/`Item` GUID properties have been deleted. +item-use behavior references now use item keys. The old cargo/consumable GUID +lookup overloads and the derived behavior `AmmoType`/`Item` GUID properties +have been deleted. Unity runtime commit DTOs carry typed `ItemKey`/`HullItemKey` fields only for loadout items, action-bar targets, body resources, entity hulls, and active consumables; the commit applier no longer reconstructs item keys from legacy diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index f1be5746e..26fb259e4 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -320,11 +320,6 @@ public abstract class Entity return _activeConsumables.FirstOrDefault(ac => ac.Item?.ItemKey == itemKey); } - public ConsumableItemEffect FindActiveConsumable(Guid itemId) - { - return FindActiveConsumable(AetheriaRuntimeItemReference.FromLegacyId(itemId)); - } - public bool CanActivateConsumable(AetheriaRuntimeCatalogItem item) { var itemKey = GetItemKey(item); @@ -426,21 +421,11 @@ public abstract class Entity return sum; } - public int CountItemsInCargo(Guid itemDataID) - { - return CountItemsInCargo(AetheriaRuntimeItemReference.FromLegacyId(itemDataID)); - } - public EquippedCargoBay FindItemInCargo(string itemKey) { return CargoBays.FirstOrDefault(c => c.ContainsItem(itemKey)); } - public EquippedCargoBay FindItemInCargo(Guid itemDataID) - { - return FindItemInCargo(AetheriaRuntimeItemReference.FromLegacyId(itemDataID)); - } - public Shape UnoccupiedSpace { get @@ -461,9 +446,11 @@ public abstract class Entity // Attempts to move a given number of items of the given type to the target Entity // Returns the number of items successfully transferred - public int TryTransferItems(Entity target, Guid itemDataID, int quantity) + public int TryTransferItems(Entity target, string itemKey, int quantity) { - var itemKey = AetheriaRuntimeItemReference.FromLegacyId(itemDataID); + if (target == null || string.IsNullOrWhiteSpace(itemKey) || quantity <= 0) + return 0; + int quantityTransferred = 0; while (quantityTransferred < quantity) { @@ -1600,11 +1587,6 @@ public class EquippedCargoBay : EquippedItem return ContainsItem(itemKey) ? ItemsOfType[itemKey].FirstOrDefault() : null; } - public ItemInstance GetFirstItem(Guid itemId) - { - return GetFirstItem(AetheriaRuntimeItemReference.FromLegacyId(itemId)); - } - public EquippedCargoBay(ItemManager itemManager, EquippableItem item, int2 position, Entity entity, string name) : base(itemManager, item, position, entity) { var typedCargoBay = ItemManager.GetRuntimeItem(EquippableItem); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index d4538e3c5..66394339e 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1229,6 +1229,9 @@ First Aetheria surfaces to publish: still derive legacy GUIDs until those structures move to typed keys. - Done: delete the `ItemInstance.ItemId` legacy-GUID projection; diagnostics now report `ItemKey` so item instances expose only typed item-key identity. + - Done: delete `Entity`/`EquippedCargoBay` cargo and consumable GUID lookup + overloads; transfer, count, active-consumable, and first-item APIs now + expose item-key contracts only. - Remove runtime dependency on `ItemData` DTOs as item instance owners. 5. Mesh host