Remove cargo GUID lookup overloads
This commit is contained in:
parent
0b92a2faae
commit
eac886d783
4 changed files with 10 additions and 24 deletions
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue