From cbea9f4b5f83f1745ab7ff01b94eb96412f8e035 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 6 Nov 2017 15:40:39 +0000 Subject: Add cell printing --- src/main/game_state.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/game_state.cpp') diff --git a/src/main/game_state.cpp b/src/main/game_state.cpp index 2dd1ca8..90a7381 100644 --- a/src/main/game_state.cpp +++ b/src/main/game_state.cpp @@ -181,6 +181,10 @@ ostream& game_state::print(ostream& stream) const { print_header(stream, "Foundations"); print_foundations(stream); } + if (rules.cells) { + print_header(stream, "Cells"); + print_cells(stream); + } if (rules.tableau_pile_count > 0) { print_header(stream, "Tableau Piles"); print_tableau_piles(stream); @@ -208,6 +212,13 @@ void game_state::print_foundations(ostream& stream) const { << foundations[3] << "\n"; } +void game_state::print_cells(ostream& stream) const { + for (pile cell : cells) { + if (!cell.empty()) stream << cells[0] << "\t"; + } + stream << "\n"; +} + void game_state::print_tableau_piles(ostream& stream) const { bool empty_row = false; vector::size_type row_idx = 0; -- cgit v1.2.1