Quaternity
debug.h
Go to the documentation of this file.
1 
8 #ifndef DEBUG_H_
9 #define DEBUG_H_
10 
11 #include <iostream>
12 #include <vector>
13 
14 #include "round.h"
15 #include "settings.h"
16 #include "state.h"
17 
21 template <class T>
22 std::ostream &operator<<(std::ostream &out, const std::vector<T> &vector)
23 {
24  out << "[";
25  for (int i = 0; i < (int)vector.size(); i++) {
26  out << vector[i];
27  if (i < (int)vector.size() - 1) {
28  out << ",";
29  }
30  }
31  out << "]";
32  return out;
33 }
34 
35 std::ostream &operator<<(std::ostream &out, const Card &card);
36 std::ostream &operator<<(std::ostream &out, const Player &player);
37 std::ostream &operator<<(std::ostream &out, const Settings &settings);
38 std::ostream &operator<<(std::ostream &out, const State &state);
39 std::ostream &operator<<(std::ostream &out, const Question &question);
40 
41 #endif /* DEBUG_H_ */
std::ostream & operator<<(std::ostream &out, const std::vector< T > &vector)
Print the elements of a vector nicely.
Definition: debug.h:22
This file defines the structs for a question and typedef of an answer.
This file defines the settings struct.
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.
Definition: state.h:19
The information connected to a player.
Definition: state.h:34
A question asked by a player. The player asks another player for a specific card from a certain set.
Definition: round.h:17
The settings which characterize a game.
Definition: settings.h:22
The complete game state.
Definition: state.h:57