Quaternity
state.h
Go to the documentation of this file.
1 
8 #ifndef STATE_H_
9 #define STATE_H_
10 
11 #include <vector>
12 
19 struct Card {
20 
28  std::vector<bool> players;
29 };
30 
34 struct Player {
35 
39  int num_cards;
40 
48  std::vector<int> sets;
49 };
50 
57 struct State {
58 
62  int onturn;
63 
74  std::vector<Card> cards;
75 
81  std::vector<Player> players;
82 
90  std::vector<int> quartets;
91 };
92 
93 State init_state(const Settings &settings);
94 State copy_state(const State &state);
95 
96 int info_num_quartets(const State &state, int player);
97 int info_num_cards(const Settings &settings, const State &state, int player);
98 
99 #endif /* STATE_H_ */
State copy_state(const State &state)
Copy the old state to a new state.
Definition: state.cpp:96
int info_num_quartets(const State &state, int player)
Get the number of quartets the given player has.
Definition: state.cpp:104
State init_state(const Settings &settings)
Initialize the starting state corresponding to the given settings.
Definition: state.cpp:58
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...
Definition: state.cpp:113
The information connected to a card.
Definition: state.h:19
std::vector< bool > players
The players which could have this card.
Definition: state.h:28
The information connected to a player.
Definition: state.h:34
std::vector< int > sets
The number of cards the player at least has from a certain set.
Definition: state.h:48
int num_cards
The number of cards this player has.
Definition: state.h:39
The settings which characterize a game.
Definition: settings.h:22
The complete game state.
Definition: state.h:57
std::vector< Player > players
The information on all the players.
Definition: state.h:81
std::vector< Card > cards
The information on all the cards.
Definition: state.h:74
int onturn
The player who is on turn.
Definition: state.h:62
std::vector< int > quartets
The information of who has a certain quartet.
Definition: state.h:90