10#include "../player/player.h"
11#include "../../serialization/unique_serializable.h"
12#include "../../serialization/serializable_value.h"
13#include "../../../../rapidjson/include/rapidjson/document.h"
33 std::vector<std::pair<card*, player*>> _cards;
46 explicit trick(
const std::string&
id);
55 trick(
const std::string&
id,
56 const std::vector<std::pair<card*, player*>> &cards,
64 explicit trick(
int trump);
142 void write_into_json(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator)
const override;
Represents a card in the game.
Definition card.h:15
Represents a player in the game.
Definition player.h:18
Definition serializable_value.h:27
Represents the trick in the game.
Definition trick.h:28
void set_trick_color(int color) const
Sets the trick color.
Definition trick.cpp:142
static trick * from_json(const rapidjson::Value &json)
Deserializes a trick object from a json object.
Definition trick.cpp:149
std::vector< std::pair< card *, player * > > get_cards_and_players() const
Gets the played cards and players who played them as pairs.
Definition trick.cpp:56
~trick() override
Destructs a trick object.
Definition trick.cpp:37
bool add_card(card *played_card, player *current_player, std::string &err)
Adds a card to the trick.
Definition trick.cpp:124
player * wrap_up_trick(std::string &err) const
Wraps up a trick at the end of a trick or round.
Definition trick.cpp:72
trick()
Constructs a new trick object.
Definition trick.cpp:10
int get_trick_color() const
Gets the trick color.
Definition trick.cpp:46
int get_trump_color() const
Gets the trump color.
Definition trick.cpp:51
void write_into_json(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Serializes a trick object into a json object.
Definition trick.cpp:175
void set_up_round(int trump, std::string &err)
Sets up a trick.
Definition trick.cpp:64
Definition unique_serializable.h:12