fix(game): add setIsUno for PlayerState

This commit is contained in:
Kieran Kihn
2025-11-16 21:47:23 +08:00
parent d658a38790
commit 6b2cb78628
2 changed files with 15 additions and 0 deletions

View File

@@ -36,6 +36,11 @@ namespace UNO::GAME {
this->remainingCardCount_ = x; this->remainingCardCount_ = x;
} }
void PlayerState::setIsUno(bool x)
{
this->isUno_ = x;
}
ServerPlayerState::ServerPlayerState(std::string name, size_t remainingCardCount, bool isUno, HandCard *handCard) : ServerPlayerState::ServerPlayerState(std::string name, size_t remainingCardCount, bool isUno, HandCard *handCard) :
PlayerState(std::move(name), remainingCardCount, isUno), handCard_(handCard) PlayerState(std::move(name), remainingCardCount, isUno), handCard_(handCard)
{ {

View File

@@ -40,7 +40,17 @@ namespace UNO::GAME {
*/ */
[[nodiscard]] size_t getRemainingCardCount() const; [[nodiscard]] size_t getRemainingCardCount() const;
/**
* 将剩余手牌设置为 x 张
* @param x 要设置的张数
*/
void setRemainingCardCount(size_t x); void setRemainingCardCount(size_t x);
/**
* 设置 Uno 状态
* @param x Uno 状态
*/
void setIsUno(bool x);
}; };
/** /**