aboutsummaryrefslogtreecommitdiff
path: root/src/main/game_state.h
diff options
context:
space:
mode:
authorthecharlesblake2017-10-24 01:23:00 +0100
committerthecharlesblake2017-10-26 14:51:33 +0100
commitc5e5d9d6bbd7d7d2a6c6463505e7b7031e846ebf (patch)
tree09bfac6f5499620317602cd8e8ab3c2933677a50 /src/main/game_state.h
parentAdd deal file parsing and verifying (diff)
downloadmetasol-c5e5d9d6bbd7d7d2a6c6463505e7b7031e846ebf.tar.gz
metasol-c5e5d9d6bbd7d7d2a6c6463505e7b7031e846ebf.zip

Draft of OO game logic

Diffstat (limited to 'src/main/game_state.h')
-rw-r--r--src/main/game_state.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/game_state.h b/src/main/game_state.h
new file mode 100644
index 0000000..693b127
--- /dev/null
+++ b/src/main/game_state.h
@@ -0,0 +1,28 @@
+//
+// Created by thecharlesblake on 10/23/17.
+//
+
+#ifndef SOLVITAIRE_GAME_STATE_H
+#define SOLVITAIRE_GAME_STATE_H
+
+#include <vector>
+#include <ostream>
+
+#include <rapidjson/document.h>
+
+#include "card.h
+
+class game_state {
+public:
+ game_state(const rapidjson::Document&);
+ virtual std::vector<game_state> get_next_legal_states() const = 0;
+ virtual bool is_solved() const = 0;
+ virtual std::ostream& print(std::ostream&) const;
+
+ friend std::ostream& operator<< (std::ostream&, const game_state&);
+
+protected:
+ std::vector<std::vector<card>> tableau_piles;
+};
+
+#endif //SOLVITAIRE_GAME_STATE_H