feat(ui): port retail item interaction policy

This commit is contained in:
Erik 2026-07-11 01:23:31 +02:00
parent 0cf780478a
commit a8da4fd05a
20 changed files with 1110 additions and 104 deletions

View file

@ -387,6 +387,7 @@ public sealed class ItemInteractionControllerTests
h.AddContained(0x50000A09u, item => item.Useability = ItemUseability.Contained);
h.Controller.ActivateItem(0x50000A09u);
h.Controller.CompleteUse(0);
h.Now += 199;
h.Controller.ActivateItem(0x50000A09u);
h.Now += 1;
@ -394,4 +395,22 @@ public sealed class ItemInteractionControllerTests
Assert.Equal(new[] { 0x50000A09u, 0x50000A09u }, h.Uses);
}
[Fact]
public void UseDone_releasesRetailBusyGate()
{
var h = new Harness();
h.AddContained(0x50000A0Au, item => item.Useability = ItemUseability.Contained);
Assert.True(h.Controller.ActivateItem(0x50000A0Au));
h.Now += 200;
Assert.False(h.Controller.ActivateItem(0x50000A0Au));
Assert.Equal(1, h.Controller.BusyCount);
h.Controller.CompleteUse(0);
h.Now += 200; // rejected busy attempt still advanced retail's throttle timestamp
Assert.True(h.Controller.ActivateItem(0x50000A0Au));
Assert.Equal(2, h.Uses.Count);
}
}