feat(game): add init method to ClientGameState

- Introduced `init` method to initialize `discardPile` in `ClientGameState`.
- Added `<ranges>` header to support future range-based operations.
This commit is contained in:
Kieran Kihn
2025-12-04 13:28:56 +08:00
parent 766e9f9a21
commit 7363556ad5
2 changed files with 12 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
*/
#include "GameState.h"
#include <ranges>
#include <stdexcept>
#include <utility>
@@ -104,6 +105,12 @@ namespace UNO::GAME {
return this->player_.getCards();
}
void ClientGameState::init(DiscardPile discardPile)
{
this->discardPile_ = std::move(discardPile);
}
void ClientGameState::draw(const Card &card)
{
this->player_.draw(card);