feat(game): add getDrawCount method to GameState

This commit is contained in:
Kieran Kihn
2025-11-17 14:01:12 +08:00
parent 6003cadc88
commit c3a5a3ee5f

View File

@@ -139,6 +139,8 @@ namespace UNO::GAME {
*/
[[nodiscard]] bool getIsReversed() const;
[[nodiscard]] size_t getDrawCount() const;
/**
* 向对局中添加玩家
* @param playerState 要添加的玩家状态
@@ -192,6 +194,13 @@ namespace UNO::GAME {
return this->isReversed_;
}
template<PlayerStateTypeConcept PlayerStateType>
size_t GameState<PlayerStateType>::getDrawCount() const
{
return this->drawCount_;
}
template<PlayerStateTypeConcept PlayerStateType>
void GameState<PlayerStateType>::addPlayer(PlayerStateType playerState)
{