summaryrefslogtreecommitdiff
path: root/common/state.h
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-19 17:50:56 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-19 17:50:56 +0100
commit10ecd24fa6f22c5b72e7cfb1b6e0025347821149 (patch)
treec437dff9320444ccecd5f69cc09c4eedbe77d361 /common/state.h
parent0da7a047a2d2be8ae3f551e0802ceaa2cd882f99 (diff)
Add Action and State classes.
Diffstat (limited to 'common/state.h')
-rw-r--r--common/state.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/common/state.h b/common/state.h
new file mode 100644
index 0000000..96f171f
--- /dev/null
+++ b/common/state.h
@@ -0,0 +1,42 @@
+#ifndef STATE_H
+#define STATE_H
+
+#include <boost/shared_ptr.hpp>
+
+#include "tile.h"
+#include "action.h"
+
+class State {
+ public:
+ typedef boost::shared_ptr<State> p;
+
+ struct Player {
+ //! Concealed tiles in hand.
+ Tiles hand;
+ //! Open tiles in hand.
+ Tiles open;
+ //! Discarded tiles.
+ Tiles pond;
+
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version) {
+ ar & hand;
+ ar & open;
+ ar & pond;
+ }
+ };
+
+ //! State of players.
+ Player players[4];
+
+ //! Possible actions.
+ Actions possible_actions;
+
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version) {
+ ar & players;
+ ar & possible_actions;
+ }
+};
+
+#endif \ No newline at end of file