From cbb49343bc4e892c63dcd600e551b6ad103a07f8 Mon Sep 17 00:00:00 2001 From: Kieran Kihn <114803508+kierankihn@users.noreply.github.com> Date: Mon, 17 Nov 2025 15:24:40 +0800 Subject: [PATCH] fix(game): refactor `GameState::onDraw` logic - Replaced direct draw and player update logic with `updateStateByDraw`. - Simplified card drawing implementation with `handCard->draw`. --- src/game/GameState.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game/GameState.cpp b/src/game/GameState.cpp index 3c71536..5372b2c 100644 --- a/src/game/GameState.cpp +++ b/src/game/GameState.cpp @@ -77,9 +77,8 @@ namespace UNO::GAME { if (this->drawCount_ == 0) { this->drawCount_ = 1; } - this->currentPlayer_->setRemainingCardCount((this->currentPlayer_->getRemainingCardCount() + this->drawCount_)); - this->currentPlayer_->draw(this->deck_.draw(this->drawCount_)); - this->drawCount_ = 0; - this->nextPlayer(); + this->currentPlayer_->handCard->draw(this->deck_.draw(this->drawCount_)); + + GameState::updateStateByDraw(); } } // namespace UNO::GAME \ No newline at end of file