refactor(D.5.4): rename ItemRepository->ClientObjectTable, ItemInstance->ClientObject

Broaden naming to the data side of every server object (retail weenie_object_table
shape). Pure rename; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-18 15:33:03 +02:00
parent 2fc253d9ff
commit b506f53633
8 changed files with 142 additions and 145 deletions

View file

@ -49,7 +49,7 @@ public sealed class ToolbarController
private readonly UiItemList?[] _slots = new UiItemList?[SlotIds.Length];
private readonly UiElement?[] _combatIndicators = new UiElement?[CombatIndicatorIds.Length];
private readonly ItemRepository _repo;
private readonly ClientObjectTable _repo;
private readonly Func<IReadOnlyList<PlayerDescriptionParser.ShortcutEntry>> _shortcuts;
private readonly Func<ItemType, uint, uint, uint, uint, uint> _iconIds; // (itemType, icon, underlay, overlay, effects) → GL tex
private readonly Action<uint> _useItem; // guid → fire UseObject
@ -68,7 +68,7 @@ public sealed class ToolbarController
private ToolbarController(
ImportedLayout layout,
ItemRepository repo,
ClientObjectTable repo,
Func<IReadOnlyList<PlayerDescriptionParser.ShortcutEntry>> shortcuts,
Func<ItemType, uint, uint, uint, uint, uint> iconIds,
Action<uint> useItem,
@ -110,8 +110,8 @@ public sealed class ToolbarController
combatState.CombatModeChanged += SetCombatMode;
// Re-bind any deferred slot whenever the repo learns about a new/updated item.
repo.ItemAdded += _ => Populate();
repo.ItemPropertiesUpdated += _ => Populate();
repo.ObjectAdded += _ => Populate();
repo.ObjectUpdated += _ => Populate();
}
/// <summary>
@ -146,7 +146,7 @@ public sealed class ToolbarController
/// </param>
public static ToolbarController Bind(
ImportedLayout layout,
ItemRepository repo,
ClientObjectTable repo,
Func<IReadOnlyList<PlayerDescriptionParser.ShortcutEntry>> shortcuts,
Func<ItemType, uint, uint, uint, uint, uint> iconIds,
Action<uint> useItem,
@ -165,7 +165,7 @@ public sealed class ToolbarController
/// Port of <c>gmToolbarUI::UpdateFromPlayerDesc</c>: clear all slots, then bind
/// each shortcut entry that has a resolved item in the repository.
/// Entries whose item is not yet in the repo are silently skipped here; the
/// <c>ItemAdded</c> event re-fires this method when the item arrives
/// <c>ObjectAdded</c> event re-fires this method when the item arrives
/// (matching retail's <c>SetDelayedShortcutNum</c> deferred-rebind path).
/// </summary>
public void Populate()
@ -180,8 +180,8 @@ public sealed class ToolbarController
var list = _slots[(int)sc.Index];
if (list is null) continue;
var item = _repo.GetItem(sc.ObjectGuid);
if (item is null) continue; // deferred: ItemAdded will re-call Populate
var item = _repo.Get(sc.ObjectGuid);
if (item is null) continue; // deferred: ObjectAdded will re-call Populate
uint tex = _iconIds(item.Type, item.IconId, item.IconUnderlayId, item.IconOverlayId, item.Effects);
list.Cell.SetItem(sc.ObjectGuid, tex);