mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
feat(command-zone): add state machine with tests
Implement CommandZoneState - a pure C++ state machine managing zone visibility transitions (Hidden, Revealed, Peeking states). The state machine is intentionally decoupled from Qt graphics: - Pure logic with no Qt dependencies in the state class - Testable in isolation without a GUI - Clear state transition table with StateChangeResult outcomes Test coverage verifies: - Initial state is Hidden - Valid transitions: Hidden->Revealed, Hidden->Peeking, etc. - Invalid transitions return NoChange - Peek timeout triggers return to previous state This establishes the foundation for command zone visibility management while keeping graphics concerns separate.
This commit is contained in:
parent
ba1a388e5d
commit
3c2e4a3fb2
6 changed files with 678 additions and 0 deletions
|
|
@ -103,6 +103,7 @@ set(cockatrice_SOURCES
|
|||
src/game/player/player_target.cpp
|
||||
src/game/replay.cpp
|
||||
src/game/zones/card_zone.cpp
|
||||
src/game/zones/command_zone_state.cpp
|
||||
src/game/zones/hand_zone.cpp
|
||||
src/game/zones/logic/card_zone_logic.cpp
|
||||
src/game/zones/logic/hand_zone_logic.cpp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue