Commit Graph

6 Commits

Author SHA1 Message Date
hypercross cbb7edd472 refactor: simplify entity lookups and clean up state updates
- Replace manual entity iteration with `world.FindEntity<T>()`
- Remove redundant `MarkModified<GameState>` calls
- Add safety counters to prevent infinite loops in tests and systems
- Call `FlushPendingMutations` after card transfers to ensure
  consistency
- Rename `Run` to `RunImpl` in several systems
2026-07-21 13:57:11 +08:00
hypercross 91c6f4aa2c refactor: remove Source property from IRelationship
Remove the redundant `Source` property from `IRelationship` and its
implementations. Since the relationship component is inherently
stored on the source entity, the `Source` field was unnecessary and
required manual synchronization during deserialization.

This change simplifies the relationship model, reduces memory usage,
and removes the need for reflection-based fixups in the serializer.
2026-07-20 22:59:27 +08:00
hypercross 10c4caed90 test: improve blackjack play tests and logging
Refactor `RunRound` to `RunUntilDone` to allow for multi-round
simulations
until a win/loss condition is met. Added round summaries, win/loss/push
tracking, and improved log formatting to provide better visibility into
agent performance.
2026-07-20 17:37:23 +08:00
hypercross 343bcd5b2e refactor: convert component structs to record structs 2026-07-20 17:15:17 +08:00
hypercross e1fb197474 feat(oecs): improve serialization and add snapshot tests
Enhance the OECS framework to support more robust component
deserialization during world serialization. This includes adding
boxed component support and a runtime fallback for component
discovery.

Additionally, introduces snapshot testing patterns for Blackjack
and TicTacToe to allow for manual verification of world state and
reactivity logs.
2026-07-20 17:05:17 +08:00
hypercross b4661e714e test: add unit tests for Blackjack and TicTacToe
- Add xUnit test projects for both games
- Implement game flow tests for Blackjack
- Implement game flow tests for TicTacToe
- Rename namespaces and projects to follow `Game.*` convention
- Add documentation for testing games
2026-07-20 16:41:10 +08:00