Remove item instance legacy ID projection

This commit is contained in:
Meta Vens 2026-06-15 02:57:50 +01:00
commit 0b92a2faae
6 changed files with 8 additions and 8 deletions

Binary file not shown.

View file

@ -85,8 +85,8 @@ been deleted from live Unity source. Surviving runtime DTOs no longer carry
legacy catalog group/table annotations; their remaining metadata is projection
and inspection metadata for the typed runtime bridge.
Item instances now carry `AetheriaRuntimeItemReference`, a typed item-key
facade. `ItemInstance.ItemKey` is the identity surface, while `ItemId` is a
derived legacy-GUID compatibility projection for broader simulation paths.
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

View file

@ -264,7 +264,7 @@ public abstract class Entity
Hull = hull;
var typedHull = itemManager.GetRuntimeItem(hull);
if (typedHull == null)
throw new InvalidOperationException($"Unable to construct entity: missing typed hull row for {hull?.ItemId}");
throw new InvalidOperationException($"Unable to construct entity: missing typed hull row for {hull?.ItemKey}");
Name = typedHull.Name;
MapEntity();
WeaponGroups = new (List<Weapon> weapons, List<EquippedItem> items)[itemManager.GameplaySettings.WeaponGroupCount];
@ -354,7 +354,7 @@ public abstract class Entity
{
var typedHull = ItemManager.GetRuntimeItem(Hull);
if (typedHull == null)
throw new InvalidOperationException($"Unable to map entity {Name}: missing typed hull row for {Hull?.ItemId}");
throw new InvalidOperationException($"Unable to map entity {Name}: missing typed hull row for {Hull?.ItemKey}");
var hullShape = GetHullShape(typedHull);
EquippedHull = new EquippedItem(ItemManager, Hull, int2.zero, this);

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -16,7 +15,6 @@ public abstract class ItemInstance
public ItemRotation Rotation;
public string ItemKey => Reference?.ItemKey ?? "";
public Guid ItemId => Reference?.LegacyItemId ?? Guid.Empty;
}
public abstract class CraftedItemInstance : ItemInstance

View file

@ -598,7 +598,7 @@ public class ItemManager
var durability = pow(item.Durability / maxDurability, durabilityExponent * stat.DurabilityExponentMultiplier);
var result = lerp(stat.Min, stat.Max, quality * durability);
if (float.IsNaN(result))
throw new InvalidOperationException($"Performance Stat on {typedItem?.Name ?? item.ItemId.ToString()} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {maxDurability}");
throw new InvalidOperationException($"Performance Stat on {typedItem?.Name ?? item.ItemKey} evaluating as NaN: input data is invalid! Durability: {item.Durability} / {maxDurability}");
return result;
}
@ -647,7 +647,7 @@ public class ItemManager
var typedItem = GetRuntimeItem(item);
if (typedItem == null)
{
_logger($"Attempted to instantiate missing item id {item?.ItemId}");
_logger($"Attempted to instantiate missing item key {item?.ItemKey}");
return null;
}

View file

@ -1227,6 +1227,8 @@ First Aetheria surfaces to publish:
references, item-use behavior references, and runtime commit item/hull
surfaces now carry typed item keys; remaining broader simulation paths
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.
- Remove runtime dependency on `ItemData` DTOs as item instance owners.
5. Mesh host