mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
fix(game): refactor GameState::onDraw logic
- Replaced direct draw and player update logic with `updateStateByDraw`. - Simplified card drawing implementation with `handCard->draw`.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user