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

@ -595,7 +595,7 @@ public sealed class GameWindow : IDisposable
// SpellTable.Empty if the file is missing (e.g. tooling contexts).
public readonly AcDream.Core.Spells.SpellTable SpellTable = LoadSpellTable();
public readonly AcDream.Core.Spells.Spellbook SpellBook = null!;
public readonly AcDream.Core.Items.ItemRepository Items = new();
public readonly AcDream.Core.Items.ClientObjectTable Objects = new();
/// <summary>Persisted hotbar shortcuts from the last PlayerDescription (D.5.1 toolbar source).</summary>
public IReadOnlyList<AcDream.Core.Net.Messages.PlayerDescriptionParser.ShortcutEntry> Shortcuts { get; private set; }
= System.Array.Empty<AcDream.Core.Net.Messages.PlayerDescriptionParser.ShortcutEntry>();
@ -2000,7 +2000,7 @@ public sealed class GameWindow : IDisposable
if (toolbarLayout is not null)
{
_toolbarController = AcDream.App.UI.Layout.ToolbarController.Bind(
toolbarLayout, Items,
toolbarLayout, Objects,
() => Shortcuts,
iconIds: (type, icon, under, over, effects) => iconComposer.GetIcon(type, icon, under, over, effects),
useItem: guid => UseItemByGuid(guid),
@ -2411,7 +2411,7 @@ public sealed class GameWindow : IDisposable
var skillTable = _dats?.Get<DatReaderWriter.DBObjs.SkillTable>(0x0E000004u);
AcDream.Core.Net.GameEventWiring.WireAll(
_liveSession.GameEvents, Items, Combat, SpellBook, Chat, LocalPlayer,
_liveSession.GameEvents, Objects, Combat, SpellBook, Chat, LocalPlayer,
TurbineChat,
resolveSkillFormulaBonus: (skillId, attrCurrents) =>
{
@ -2636,8 +2636,8 @@ public sealed class GameWindow : IDisposable
// repository so a draining/charging item re-composites its icon in real time.
_liveSession.ObjectIntPropertyUpdated += u =>
{
if (u.Property == AcDream.Core.Items.ItemRepository.UiEffectsPropertyId)
Items.UpdateIntProperty(u.Guid, u.Property, u.Value);
if (u.Property == AcDream.Core.Items.ClientObjectTable.UiEffectsPropertyId)
Objects.UpdateIntProperty(u.Guid, u.Property, u.Value);
};
}
@ -2652,7 +2652,7 @@ public sealed class GameWindow : IDisposable
// with the icon/name/type its CreateObject carries, so the toolbar can render it.
// D.5.1 (2026-06-17): also pass overlay/underlay ids from the extended
// WeenieHeader tail so IconComposer composites all icon layers.
Items.EnrichItem(spawn.Guid, spawn.IconId, spawn.Name ?? string.Empty,
Objects.EnrichItem(spawn.Guid, spawn.IconId, spawn.Name ?? string.Empty,
(AcDream.Core.Items.ItemType)(spawn.ItemType ?? 0),
spawn.IconOverlayId, spawn.IconUnderlayId, spawn.UiEffects);

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);