aboutsummaryrefslogtreecommitdiff
path: root/src/main/game_state.cpp
diff options
context:
space:
mode:
authorthecharlesblake2017-11-06 15:40:39 +0000
committerthecharlesblake2017-11-06 15:40:39 +0000
commitcbea9f4b5f83f1745ab7ff01b94eb96412f8e035 (patch)
tree516a7ab951e7f81e07f4646f473508c3c064ab13 /src/main/game_state.cpp
parentAdd cells to game state and next state generation (diff)
downloadmetasol-cbea9f4b5f83f1745ab7ff01b94eb96412f8e035.tar.gz
metasol-cbea9f4b5f83f1745ab7ff01b94eb96412f8e035.zip

Add cell printing

Diffstat (limited to 'src/main/game_state.cpp')
-rw-r--r--src/main/game_state.cpp11
1 files changed, 11 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;