Commit Graph

120 Commits

Author SHA1 Message Date
49aacb087a refactor: 调整录像命名 2026-09-16 21:51:19 +08:00
6c4d3709d3 test(06-18): migrate 5 existing perf files to performance.mark/measure
- measureCase sampling loop now pairs mark(startTag)/mark(endTag) with
  measure(measureName, startTag, endTag) and clears marks/measures per sample
- tag names derive from caseName+scale so they never collide across cases
- WARMUP_RUNS/SAMPLE_RUNS/median/min/p95/toFixed(3)/columns unchanged
2026-09-16 20:26:42 +08:00
b2626bd438 fix(07-09): keep hero attribute instance stable and clear generic variance
- HeroAttribute.loadState replaces its private base object; the HeroAttribute wrapper identity is preserved so equipment/combat references stay valid across load (#06-17-1/#06-17-2).

- Clone the incoming base attribute in the constructor so the shared HERO_DEFAULT_ATTRIBUTE is no longer mutated across CoreState instances.

- Use any for the hero position in combat handler/aura/enemy-view generics to clear the 45 new type errors introduced by HeroAttribute implementing ISaveableContent.
2026-09-16 19:35:54 +08:00
1f0af69004 fix(07-09): #06-17-1 load hero attribute in place and keep equipment bonuses
- IHeroStateSave.attribute becomes IHeroAttributeSave<THero>; top-level modifiers removed
- HeroState.attribute is readonly and loadState delegates to attribute.loadState (never reassigns)
- delete attachAttribute from IHeroState and HeroState, and its only test case
- thin-delegate registerModifier/createModifier/createAndInsertModifier to the attribute registry
- loadEquipEffect mounts equipment modifiers with save=false so equipment bonuses only return via re-equip
- add #06-17-1 regressions: same attribute instance, bonuses kept, no double-count when type is registered
2026-09-16 18:43:33 +08:00
6a60476531 feat(07-09): make HeroAttribute own its save state in place
- add IHeroAttributeSave<THero> and have IHeroAttribute extend ISaveableContent
- move the modifier factory registry into HeroAttribute with registerModifier/createModifier/createAndInsertModifier
- implement in-place saveState/loadState (values deep copy, save-enabled modifier enumeration, registry-driven rebuild)
- carry registry entries into clone() output
- introduce IHeroModifierOwner so modifier owner typing stays assignable for generic attributes
- add attribute.test.ts same-reference save/load regressions across all compressions
2026-09-16 18:37:54 +08:00
3c59f31e6f test(06-16): add enemy context buildup and hero attribute perf suites
- context.perf.ts: 3 cases (50/200/1000 enemies), fixed 10 global auras + 5 special codes, cached aura topology, one buildup per sample
- attribute.perf.ts: 3 cases (10/100/1000 modifiers over 10 attributes), 1000 recalc rounds per sample via markModifierDirty + getFinalAttribute
- warmup 3 + 20 samples, median/min/p95 via console.table, no assertions
2026-09-16 15:02:57 +08:00
620382cc5f fix(07-05): #06-06-1 warn code 128 for an out-of-map dynamic transfer
- transferToDynamic 越界分支由 131 改为 128,对齐两个 transferToStatic* 兄弟分支
- 取消 mapLayer.test.ts 的码 128 用例 skip
2026-09-15 20:45:01 +08:00
3b1b9f1d5c fix(07-05): #06-09-3 restore the dynamic tile num on load
- loadState 先 this.set(save.num),再恢复存档事件
- 取消 saveLoad.test.ts 的 num 恢复用例 skip
2026-09-15 20:43:20 +08:00
2d2855c394 chore(07-04): #06-05-3 annotate the retained 147 skip and close windows 25/26
- D-06: equipment.test.ts code-147 case stays it.skip with a Chinese note that 147 is a reserved code, currently unreachable by design; no production code touched
- WINDOWS.md ids 25/26 marked fixed (open_count 13 -> 11); no new ledger entries
2026-09-15 20:34:03 +08:00
2452711edb fix(07-04): #06-05-2 prefer the first empty named slot
- getCouldEquipSlot tests empty === -1 so the first empty named slot wins instead of always replacing the first match
- un-skip the named-slot empty-preference case; canEquipTo string branch untouched
2026-09-15 20:30:32 +08:00
04943416a5 fix(07-04): #06-05-1 refresh final attributes without modifiers
- recalculateAttribute writes the base value into finalAttribute when no modifier is attached
- un-skip the base-only-change case; catchCalculateProgress is intentionally left untouched
2026-09-15 20:29:27 +08:00
02786047d2 fix(07-04): #06-09-2 deep copy the equipment save snapshot
- saveState returns new Map(this.equips) and [...this.slots] so the snapshot is decoupled from the live state
- un-skip the independent-snapshot and container round-trip cases
2026-09-15 20:27:57 +08:00
e7f341095d fix(07-04): #06-09-1 restore equipment modifiers from split save tables
- loadNoCompression reads value entries from state.value instead of state.percentage
- loadDiff seeds this.value/this.percentage from the item.equip base definition before applying save diffs
- un-skip the four correct-expectation EquipmentState round-trip cases (Low/High percentage, NoCompression value, compressed unchanged value)
2026-09-15 20:26:45 +08:00
b70ccbd5f6 fix(07-02): #06-03-1 resolve the reuse mapping in enemy creation
- createEnemy/createEnemyById now resolve prefabs through internalGetPrefab,
  matching getPrefab/deletePrefab/modifyPrefabAttribute behaviour
- add a Chinese invariant comment above createEnemyById covering all
  code/id prefab entry points
- un-skip the two correct-expectation reuse mapping cases in manager.test.ts
  (assertions unchanged) and sync their Chinese comments
2026-09-15 17:16:44 +08:00
8a7cda95ae test(06-13): tier map tile save/load across all compressions (G-06-09-B)
- StaticTile covered-event round trip looped over NoCompression/LowCompression/HighCompression
- DynamicTile covered-event round trip looped over the three tiers, keeping the tile num assertion
- Existing #06-09-3 it.skip unchanged
2026-09-15 11:24:08 +08:00
6d7e57ab34 test(06-13): tier hero save/load classes across all compressions (G-06-09-B)
- EquipmentState percentage round trip per tier (NoCompression green; Low/High correct-expectation it.skip anchored #06-09-1)
- HeroItems constant/consumable tables and HeroState attributes/location loop over the three compression tiers
- HeroState container covers HeroLocation/HeroRendering across tiers; HeroEquipment container expectation it.skip anchored #06-09-2
- Existing #06-09-1/#06-09-2 skips unchanged
2026-09-15 11:22:52 +08:00
e2c163899d test(06-12): register blocked four-facing prefab reuse expectation (G-06-03-A)
- add correct-expectation it.skip for four facing codes reusing one prefab
- append 06-12 coverage-gap section to 06-COVERAGE-MAP.md
2026-09-15 10:43:03 +08:00
309f1b1850 test(06-11): cover static-dynamic-move-static full chain (G-06-06-A)
- mapLayer.test.ts: both keepEvent branches verified after a real-timer move,
  with exact event maps, dirty flags, block write-back and dynamic index updates
- 06-COVERAGE-MAP.md: append the 06-11 gap-fill section (create-or-append)
2026-09-15 10:27:59 +08:00
41da613f0b test(06-11): cover coexisting map layers of different z-index (G-06-06-C)
- gameMap.test.ts: three layers at z-index 1/5/9 keep independent block data and
  are judged separately by z-index during compareWith (missing ref marks dirty)
2026-09-15 10:25:17 +08:00
436386ea67 test(06-11): cover multi-slot equipment merge and createMap content generation
- equipment.test.ts: G-06-05-A asserts combined atk/def for weapon+armor and keeps the other slot's modifier after unequip
- mapState.test.ts: G-06-06-B writes/reads block, point event, event layer binding and dirty flag on a createMap floor
2026-09-15 10:23:16 +08:00
c08f3f8484 fix(replay): enable recording guard; update tests for replay refactor 2026-09-14 20:14:01 +08:00
17d7c8f46a refactor: refactor replay system record. 2026-09-14 19:55:20 +08:00
2ff422a682 test(06): restore suite green after replaySystem wiring change 2026-09-14 19:16:32 +08:00
c707c87add test(06-09): cover map, replay and flag save/load round trips
- add map/saveLoad.test.ts: StaticTile/DynamicTile/MapLayer/GameMap/MapState round trips, codes 55/122/124
- add replay/saveLoad.test.ts: ReplayArray and ReplaySystem same-instance round trips
- add flag/saveLoad.test.ts: FlagSystem round trip and separated snapshot
2026-09-14 18:57:51 +08:00
3e29548bfa test(06-09): cover enemy and hero save/load round trips
- add enemy/saveLoad.test.ts: Enemy/special/EnemyManager same-instance round trips across 3 compressions, codes 119/120
- add hero/saveLoad.test.ts: modifier/location/rendering/equipment/equipStore/items/follower/state round trips, codes 58/59
- add 06-SAVE-EXCLUSIONS.md: per-class excluded fields and rationale (D-42)
2026-09-14 18:57:42 +08:00
cee843981f feat: 录像记录 & CoreState 存储接口 2026-09-14 18:09:45 +08:00
2cb9bba3ce test(06-08): cover FlagSystem, FaceManager handlers and RoleFaceBinder (stage 2)
- add system.test.ts covering the full FlagSystem public surface and warn code 111
- add faceManager.test.ts covering FaceManager registry plus Dir4/Dir8 handlers
- add face.test.ts covering RoleFaceBinder malloc/bind/query and error codes 43/44
2026-09-14 16:56:17 +08:00
235eb1a5c9 test(06-06): cover DynamicTileMover async lifecycle (stage 3)
- mover.test.ts: successful step and layer reindex, cumulative/diagonal movement, warn 126 on an unexpected move code, lifecycle hook order, concurrent start rejection, initial face direction
2026-09-14 16:28:30 +08:00
b971e145e9 test(06-06): cover map registration, layers and dynamic conversion (stage 2)
- mapState.test.ts: createMap/getMap, raw validation codes 60/61/62/63/64, activation, areas, compareWith
- gameMap.test.ts: layer lifecycle, aliases 84, background, event layer 131, dirty, resizeLayer, compareWith
- mapLayer.test.ts: matrix, getMapData 80/81, putMapData 8/9, setMapRef 123, dynamic conversion 127/128/129/130, point events, dirty/compareWith, async doors 46
- eventView extension plus stage 1 files already committed
2026-09-14 16:26:10 +08:00
4cffe90794 test(06-06): cover map tile units and event view (stage 1)
- tile.test.ts: MapTileBase num/raw/set, default-event restore, per-tile event view, pointEvent linkage, setFaceDirection binder mapping
- staticTile.test.ts: num/raw/set/raw-miss/shouldSave/toDynamic
- dynamicTile.test.ts: create warn 143, num/raw/set, setPos, face direction, toStatic/toStaticIfSafe, step, delete
- eventView.test.ts: extend per-priority dirty tracking and duplicate priority warn 136
2026-09-14 16:19:09 +08:00
351111487a test(06-05): cover HeroMover async movement and HeroRendering (stage 3)
- add mover.test.ts: config round-trip, Step/CannotMove/Hit, out-of-bound, terrain bypass, enter/leave order, code 144
- add rendering.test.ts: default alpha, setAlpha hook, hook unload
2026-09-14 15:55:08 +08:00
6d5081abcb test(06-05): cover hero assembly and item/equipment pipeline (stage 2)
- add location/state tests: locator, floor/pos hooks, subsystem assembly, code 116, changeFloor hook order
- add equipment/equipStore/items tests: equip/unequip/replace, compareEquip, instance sorting, item routing, code 146
- add follower tests: add/remove hooks, neighbour links, sync/async gather, code 142
- record suspected bugs #06-05-2/#06-05-3 (named-slot empty check, unreachable code 147) as it.skip
2026-09-14 15:52:32 +08:00
c1781b8102 test(06-05): cover HeroAttribute and hero modifier formulas (stage 1)
- add attribute.test.ts: base/final, priority sort, delete, save flag, clone, codes 108/109
- add modifier.test.ts: value/percentage formulas, default priorities, setValue recompute
- record suspected bug #06-05-1 (no-modifier final value stale) as it.skip
2026-09-14 15:43:59 +08:00
7012aa49fc test(06-03): cover EnemyManager registry, prefab, reuse and dirty (stage 3)
- registry/attribute defaults incl. error 53 for non-serializable values
- prefab add/get/create/delete/change and reuse mapping reads
- modifyPrefabAttribute callback and index rebuild
- comparer lifecycle: warn 117 on repeat compareWith, warn 118 without comparer
- skip #06-03-1 (createEnemy does not resolve reuse mapping) per D-05
2026-09-14 14:39:41 +08:00
ff752713b9 test(06-03): cover Enemy special CRUD and clone/copyFrom (stage 2)
- enemy.test.ts: addSpecial/get/has/iterate, duplicate warn 96, delete by object/code, clone/copyFrom independence
- special.test.ts: clone value independence and deepEqualsTo code/value rules, NonePropertySpecial clone
2026-09-14 14:35:24 +08:00
965868c219 test(06-03): add Enemy attribute and special unit tests (stage 1)
- enemy.test.ts: attribute get/set/add independence and cloneAttributes deep copy
- special.test.ts: CommonSerializableSpecial value/name/description and NonePropertySpecial units
- fixtures inline, legacy and save/load excluded per D-30/D-32
2026-09-14 14:32:40 +08:00
a66be585d1 feat(event): rework built-ins and centralize trigger collection
- rename deleteBlock -> removeBlock (dynamic tiles need dynamic:true),
  moveHeroStep -> stepHero; touchFront steps forward and lets the mover bump
- GameEventSystem.collectEvent owns point/tile source collection; moverImpl
  enter/leave/hit reuse it with OnEnter/OnLeave/OnTouch
- IBlockEventEnv gains required system field and nullable heroFloor
- MapLayer.removeBlock added and setBlock guarded by inMap; GameMap owns floorId
- IObjectMover.push accepts readonly steps
- update event/eventDispatch tests to the current implementation (fixtures
  supply system, hero location snapshots, renamed registrations)

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 20:37:32 +08:00
2794dfc32d style(03-05): normalize scoped data gate formatting 2026-09-10 17:53:33 +08:00
64b97bc515 fix(03-05): close data package type and cycle boundaries 2026-09-10 17:40:29 +08:00
4eec08638e feat(03-01): add awaited replay movement tracer
- exercise source-aware event mutation on a fixed map
- verify Node replay reaches its normal end state
2026-09-10 15:43:26 +08:00
a707be4856 feat(03-01): add Node-safe core state construction
- isolate legacy loading behind internal dependencies
- provide memory saves and remove singleton back-edges
2026-09-10 15:35:01 +08:00
7f19773477 chore(03): checkpoint data layer structure 2026-09-10 13:30:53 +08:00
26f7ad6b2e refactor(02-06): align pathfinding structure with user scope 2026-09-10 11:21:53 +08:00
2759df531e feat(02-03): wire hero pathfinding movement
- Bind the hero predicate and event layer into the L2 finder
- Execute translated paths through the hero mover and export the L3 entry
2026-09-09 21:13:30 +08:00
68a150882c refactor(02-03): extract hero pass predicate
- Move passability and hit checks behind IPassPredicate
- Keep hero mover event dispatch and move codes unchanged
2026-09-09 21:06:07 +08:00
7dd4f39e7e fix: getLocationData logic 2026-09-09 19:42:37 +08:00
7a011b29c2 feat: 完成寻路系统接口设计 2026-09-09 16:40:56 +08:00
1d9b180d5f docs(test): describe individual test cases 2026-09-09 13:33:42 +08:00
4349e67669 docs(test): require test scope comments 2026-09-09 13:12:10 +08:00
33966fb4dd test(event): polyfill map insertion in fixtures 2026-09-09 13:06:27 +08:00