diff options
| author | thecharlesblake | 2017-11-06 15:40:39 +0000 |
|---|---|---|
| committer | thecharlesblake | 2017-11-06 15:40:39 +0000 |
| commit | cbea9f4b5f83f1745ab7ff01b94eb96412f8e035 (patch) | |
| tree | 516a7ab951e7f81e07f4646f473508c3c064ab13 /src/main | |
| parent | Add cells to game state and next state generation (diff) | |
| download | metasol-cbea9f4b5f83f1745ab7ff01b94eb96412f8e035.tar.gz metasol-cbea9f4b5f83f1745ab7ff01b94eb96412f8e035.zip | |
Add cell printing
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/game_state.cpp | 11 | ||||
| -rw-r--r-- | src/main/game_state.h | 1 |
2 files changed, 12 insertions, 0 deletions
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<card>::size_type row_idx = 0; diff --git a/src/main/game_state.h b/src/main/game_state.h index bb98ee3..97a1bec 100644 --- a/src/main/game_state.h +++ b/src/main/game_state.h @@ -36,6 +36,7 @@ private: void print_header(std::ostream&, const char*) const; void print_foundations(std::ostream&) const; + void print_cells(std::ostream&) const; void print_tableau_piles(std::ostream&) const; void print_hole(std::ostream&) const; |
