fix output operator for stack
This commit is contained in:
parent
2735e66ade
commit
704913b64c
2 changed files with 6 additions and 6 deletions
|
@ -73,10 +73,10 @@ constexpr Card y4 = {1, 4};
|
||||||
* - Number of clues
|
* - Number of clues
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <suit_t num_suits>
|
template <size_t num_suits>
|
||||||
using Stacks = std::array<rank_t, num_suits>;
|
using Stacks = std::array<rank_t, num_suits>;
|
||||||
|
|
||||||
template <suit_t num_suits>
|
template <size_t num_suits>
|
||||||
std::ostream& operator<<(std::ostream &os, const Stacks<num_suits> &stacks);
|
std::ostream& operator<<(std::ostream &os, const Stacks<num_suits> &stacks);
|
||||||
|
|
||||||
struct CardMultiplicity {
|
struct CardMultiplicity {
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Hanabi {
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<suit_t num_suits>
|
template<size_t num_suits>
|
||||||
std::ostream& operator<<(std::ostream &os, const Stacks<num_suits> &stacks) {
|
std::ostream& operator<<(std::ostream &os, const Stacks<num_suits> &stacks) {
|
||||||
for (size_t i = 0; i < stacks.size() - 1; i++) {
|
for (size_t i = 0; i < stacks.size() - 1; i++) {
|
||||||
os << starting_card_rank - stacks[i] << ", ";
|
os << starting_card_rank - stacks[i] << ", ";
|
||||||
|
@ -189,7 +189,7 @@ namespace Hanabi {
|
||||||
|
|
||||||
template<suit_t num_suits, player_t num_players, hand_index_t hand_size>
|
template<suit_t num_suits, player_t num_players, hand_index_t hand_size>
|
||||||
void HanabiState<num_suits, num_players, hand_size>::print(std::ostream &os) const {
|
void HanabiState<num_suits, num_players, hand_size>::print(std::ostream &os) const {
|
||||||
// os << "Stacks: " << _stacks << " (score " << +_score << ")";
|
os << "Stacks: " << _stacks << " (score " << +_score << ")";
|
||||||
os << ", clues: " << +_num_clues << ", turn: " << +_turn << std::endl;
|
os << ", clues: " << +_num_clues << ", turn: " << +_turn << std::endl;
|
||||||
os << "Draw pile: ";
|
os << "Draw pile: ";
|
||||||
for (const auto &[card, mul]: _draw_pile) {
|
for (const auto &[card, mul]: _draw_pile) {
|
||||||
|
|
Loading…
Reference in a new issue