refactor(replay): rewrite remaining commands and register in CoreState

- ReplayUseItemCommand / ReplayEquipCommand / ReplayUnequipCommand now extend
  BaseReplayCommand with fixed numeric params and per-false-position logger
  error codes (2006-2010); string item/slot params removed, autoUnload is a
  required bool.
- remove isNumber/isItem/isBoolean/isSlot/resolveSlot helpers; all logic now
  lives in the command classes.
- drop createReplayCommandItems/registerReplayCommandItems; CoreState owns a
  private registerReplayCommand() registering the eight stable codes directly.
- prune unused replay boundary types from replay/types.ts.
- fix ReplaySandbox: a replay ending on a run of moves now finalizes the
  trailing run through notExecuted (previously the last move never started).
- rewrite commands.test.ts for the base-class design and direct registration.

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
This commit is contained in:
AncTe committed 2026-09-13 15:39:12 +08:00
1 parent 37bfb77301
commit dd4e66a335
6 files changed
+398 -569

No files matched your search

+6 -1
View File
@@ -69,7 +69,12 @@
"2002": "Replay($1): Replay parameter type mismatch: index $2, expected $3, got $4.",
"2003": "Replay(move): Expected hero to be stopped before execute moving step.",
"2004": "Replay(move): Unexpected move controller missing while executing move behavior.",
"2005": "Replay(teleport): Cannot find a way to target position: $1,$2."
"2005": "Replay(teleport): Cannot find a way to target position: $1,$2.",
"2006": "Replay(use-item): Failed to use item number $1.",
"2007": "Replay(equip): Cannot equip uid $1 into slot $2.",
"2008": "Replay(equip): Equipping uid $1 into slot $2 did not take effect.",
"2009": "Replay(unequip): No equipment in slot $1.",
"2010": "Replay(unequip): Unequipping slot $1 did not take effect."
},
"warn": {
"1": "Resource with type of 'none' is loaded.",