Commit Graph

7 Commits

Author SHA1 Message Date
Kieran Kihn
0802d989f8 refractor(game): enhance state management with clear and endGame methods
- Added `clear` methods to `PlayerState`, `ServerPlayerState`, and `HandCard`.
- Introduced `endGame` methods to `GameState`, `ClientGameState`, and `ServerGameState`.
- Improved `init` and `nextPlayer` logic in `ClientGameState`.
- Added `getClientGameStage` and `getServerGameStage` methods to retrieve game stages.
2025-12-07 19:03:13 +08:00
Kieran Kihn
5196de460a refactor(game): simplify card play logic
- Replaced iterator-based `play` methods with a single card-based method.
- Streamlined logic in `ServerPlayerState`, `ClientGameState`, and `HandCard`.
2025-12-07 13:57:54 +08:00
Kieran Kihn
e78741bd9d refactor(game): encapsulate Player and ClientGameState state management
- Replaced public `Player::handCard` pointer with private `HandCard` member.
- Introduced `draw`, `play`, and `getCards` methods in `Player` and `ClientGameState`.
- Modified `ClientGameState` constructor to accept player name instead of `Player` object.
- Updated tests to reflect new `Player` and `ClientGameState` structure.
2025-11-18 17:15:07 +08:00
Kieran Kihn
091e5f33ca refactor(game): make HandCard default-constructible
- Removed the constructor requiring an array of cards.
2025-11-17 21:14:36 +08:00
Kieran Kihn
375abeb2bb fix(game): update Player constructor to take std::string by value instead of reference 2025-11-16 22:06:42 +08:00
Kieran Kihn
e2a27e4417 refactor(game): renamed handCard_ to handCard in Player 2025-11-16 20:21:35 +08:00
Kieran Kihn
1b9ff0b413 feat(game): add Player 2025-11-16 19:52:09 +08:00