refactor(runtime): own interaction transactions
Move use throttling, appraisal identity, queued interactions, and exact post-arrival pickup state beneath RuntimeActionState. Keep App as the picker, movement, transport, and retained-presentation adapter while preserving retail send and UseDone ordering. Add reset, disposal, GUID-reuse, callback-reentrancy, and transport-failure coverage. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
parent
be73bccf5a
commit
f5f7b4177f
31 changed files with 1365 additions and 432 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using AcDream.App.UI;
|
||||
using AcDream.Core.Combat;
|
||||
using AcDream.Core.Items;
|
||||
using AcDream.Runtime.Gameplay;
|
||||
|
||||
namespace AcDream.App.Tests.UI;
|
||||
|
||||
|
|
@ -32,6 +33,7 @@ public sealed class ItemInteractionControllerTests
|
|||
public readonly CombatState Combat = new();
|
||||
public readonly StackSplitQuantityState SplitQuantity = new();
|
||||
public readonly InventoryTransactionState SharedTransactions;
|
||||
public readonly RuntimeInteractionTransactionState RuntimeTransactions;
|
||||
public uint SelectedObject;
|
||||
public bool NonCombatMode;
|
||||
public bool DragOnPlayerOpensSecureTrade = true;
|
||||
|
|
@ -56,10 +58,12 @@ public sealed class ItemInteractionControllerTests
|
|||
});
|
||||
Objects.MoveItem(Pack, Player, 0);
|
||||
SharedTransactions = new InventoryTransactionState(Objects);
|
||||
RuntimeTransactions = new RuntimeInteractionTransactionState(
|
||||
SharedTransactions);
|
||||
|
||||
Controller = new ItemInteractionController(
|
||||
Objects,
|
||||
SharedTransactions,
|
||||
RuntimeTransactions,
|
||||
new InteractionState(),
|
||||
playerGuid: () => Player,
|
||||
sendUse: requestUse is null ? Uses.Add : null,
|
||||
|
|
@ -338,10 +342,12 @@ public sealed class ItemInteractionControllerTests
|
|||
var objects = new ClientObjectTable();
|
||||
using var transactions =
|
||||
new InventoryTransactionState(new ClientObjectTable());
|
||||
using var runtimeTransactions =
|
||||
new RuntimeInteractionTransactionState(transactions);
|
||||
|
||||
Assert.Throws<ArgumentException>(() => new ItemInteractionController(
|
||||
objects,
|
||||
transactions,
|
||||
runtimeTransactions,
|
||||
new InteractionState(),
|
||||
playerGuid: () => Player,
|
||||
sendUse: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue