From 704913b64c31f3347b94b4e3e8a955de04017450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Mon, 7 Aug 2023 10:45:11 +0200 Subject: [PATCH] fix output operator for stack --- game_state.h | 6 +++--- game_state.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/game_state.h b/game_state.h index be7541e..7d7b424 100644 --- a/game_state.h +++ b/game_state.h @@ -73,11 +73,11 @@ constexpr Card y4 = {1, 4}; * - Number of clues */ -template +template using Stacks = std::array; -template -std::ostream &operator<<(std::ostream &os, const Stacks &stacks); +template +std::ostream& operator<<(std::ostream &os, const Stacks &stacks); struct CardMultiplicity { Card card; diff --git a/game_state.hpp b/game_state.hpp index a0a3cfd..298ab2c 100644 --- a/game_state.hpp +++ b/game_state.hpp @@ -27,8 +27,8 @@ namespace Hanabi { return os; } - template - std::ostream &operator<<(std::ostream &os, const Stacks &stacks) { + template + std::ostream& operator<<(std::ostream &os, const Stacks &stacks) { for (size_t i = 0; i < stacks.size() - 1; i++) { os << starting_card_rank - stacks[i] << ", "; } @@ -189,7 +189,7 @@ namespace Hanabi { template void HanabiState::print(std::ostream &os) const { -// os << "Stacks: " << _stacks << " (score " << +_score << ")"; + os << "Stacks: " << _stacks << " (score " << +_score << ")"; os << ", clues: " << +_num_clues << ", turn: " << +_turn << std::endl; os << "Draw pile: "; for (const auto &[card, mul]: _draw_pile) {