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:
Kieran Kihn
2025-11-17 15:24:40 +08:00
parent b8761d1809
commit cbb49343bc

View File

@@ -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