mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user