22 std::vector<Card> cards;
25 cards.push_back(card);
41 std::vector<Player> players;
43 Player player = {NUM_CARDS, std::vector<int>(settings.
NUM_SETS, 0)};
44 players.push_back(player);
60 std::vector<int> quartets(settings.
NUM_SETS, -1);
67 std::vector<Card>
copy_cards(
const std::vector<Card> cards)
69 std::vector<Card> cards_copy;
70 for (
Card card: cards) {
72 cards_copy.push_back(card_copy);
80 std::vector<Player>
copy_players(
const std::vector<Player> players)
82 std::vector<Player> players_copy;
83 for (
Player player: players) {
85 players_copy.push_back(player_copy);
This file defines the settings struct.
State copy_state(const State &state)
Copy the old state to a new state.
std::vector< Card > copy_cards(const std::vector< Card > cards)
Copy the old cards vector to a new cards vector.
std::vector< Card > init_cards(const Settings &settings)
Initialize the cards corresponding to the given settings.
int info_num_quartets(const State &state, int player)
Get the number of quartets the given player has.
std::vector< Player > copy_players(const std::vector< Player > players)
Copy the old player vector to a new player vector.
State init_state(const Settings &settings)
Initialize the starting state corresponding to the given settings.
int info_num_cards(const Settings &settings, const State &state, int player)
Get the number of cards the player has without counting the cards from quartets, so the actual number...
std::vector< Player > init_players(const Settings &settings)
Initialize the players corresponding to the given settings.
This file defines the structs for a card, player and a game state, plus a state initialize and copy f...
The information connected to a card.
std::vector< bool > players
The players which could have this card.
The information connected to a player.
int num_cards
The number of cards this player has.
The settings which characterize a game.
const int NUM_SETS
The number of sets.
const int SET_SIZE
The size of one set, aka the number of cards in one set.
const int NUM_PLAYERS
The number of players playing the game.
std::vector< Player > players
The information on all the players.
std::vector< Card > cards
The information on all the cards.
int onturn
The player who is on turn.
std::vector< int > quartets
The information of who has a certain quartet.