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.
This commit is contained in:
Kieran Kihn
2025-12-07 19:03:13 +08:00
parent ebb49a02ef
commit 0802d989f8
4 changed files with 134 additions and 25 deletions

View File

@@ -59,6 +59,11 @@ namespace UNO::GAME {
* @return 手牌是否为空
*/
[[nodiscard]] bool isEmpty() const;
/**
* 清空手牌
*/
void clear();
};
/**
@@ -105,6 +110,11 @@ namespace UNO::GAME {
* @return 手牌是否为空
*/
[[nodiscard]] bool isEmpty() const;
/**
* 清空手牌
*/
void clear();
};
} // namespace UNO::GAME