mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 10:23:16 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user