fix(ui): select and examine favorite spells like retail

This commit is contained in:
Erik 2026-07-24 06:47:54 +02:00
parent 043ab10b3c
commit 3e31b0ac70
23 changed files with 974 additions and 34 deletions

View file

@ -165,6 +165,39 @@ public sealed class SpellComponentRequirementServiceTests
Assert.False(service.HasRequiredComponents(50u));
}
[Fact]
public void ExaminationFormulaPreservesOrderAndReportsNestedOwnership()
{
var objects = new ClientObjectTable();
objects.AddOrUpdate(new ClientObject { ObjectId = 1u, Name = "Player" });
objects.AddOrUpdate(new ClientObject
{
ObjectId = 2u,
ContainerId = 1u,
Type = ItemType.Container,
});
objects.AddOrUpdate(new ClientObject
{
ObjectId = 3u,
WeenieClassId = 101u,
ContainerId = 2u,
});
var service = Service(
objects,
[10u, 11u, 10u],
new Dictionary<uint, uint>
{
[10u] = 101u,
[11u] = 102u,
});
Assert.Equal(
new uint[] { 10u, 11u, 10u },
service.GetAppropriateFormula(50u));
Assert.True(service.IsComponentOwned(10u));
Assert.False(service.IsComponentOwned(11u));
}
private static SpellComponentRequirementService Service(
ClientObjectTable objects,
IReadOnlyList<uint> components,