aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/output/state_printer.h
diff options
context:
space:
mode:
authorthecharlesblake2018-01-03 15:21:47 +0000
committerthecharlesblake2018-01-03 15:21:47 +0000
commit4208d2570e74ab54d1878c72110bd380e7b197f2 (patch)
treeb56d48744597a426a3218c75b0342a8c0fbabdeb /src/main/input-output/output/state_printer.h
parentRefactor io dir structure (diff)
downloadmetasol-4208d2570e74ab54d1878c72110bd380e7b197f2.tar.gz
metasol-4208d2570e74ab54d1878c72110bd380e7b197f2.zip

Move game state printing into dedicated class

Diffstat (limited to 'src/main/input-output/output/state_printer.h')
-rw-r--r--src/main/input-output/output/state_printer.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/input-output/output/state_printer.h b/src/main/input-output/output/state_printer.h
new file mode 100644
index 0000000..c918bcd
--- /dev/null
+++ b/src/main/input-output/output/state_printer.h
@@ -0,0 +1,28 @@
+//
+// Created by thecharlesblake on 1/3/18.
+//
+
+#ifndef SOLVITAIRE_STATE_PRINT_H
+#define SOLVITAIRE_STATE_PRINT_H
+
+#include <ostream>
+
+#include "../../game/game_state.h"
+
+class state_printer {
+public:
+ static std::ostream& print(std::ostream&, const game_state&);
+
+private:
+ static void print_header(std::ostream&, const char*);
+ static void print_piles(std::ostream&,
+ const std::vector<game_state::pile_ref>&,
+ const game_state&);
+ static void print_top_of_piles(std::ostream&,
+ const std::vector<game_state::pile_ref>&,
+ const game_state&);
+ static void print_top_of_pile(std::ostream&, game_state::pile_ref,
+ const game_state&);
+};
+
+#endif //SOLVITAIRE_STATE_PRINT_H