summaryrefslogtreecommitdiff
path: root/common/action.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/action.h
parent0da7a047a2d2be8ae3f551e0802ceaa2cd882f99 (diff)
Add Action and State classes.
Diffstat (limited to 'common/action.h')
-rw-r--r--common/action.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/common/action.h b/common/action.h
new file mode 100644
index 0000000..21fc7d0
--- /dev/null
+++ b/common/action.h
@@ -0,0 +1,36 @@
+#ifndef ACTION_H
+#define ACTION_H
+
+#include <vector>
+
+class Action {
+ public:
+ //! Action types.
+ enum Type {
+ Pass, // discard
+ Discard, // draw
+ Riichi, // draw
+ Chi, // discard
+ Pon, // discard
+ Kan, // draw, discard
+ Ron, // discard
+ Tsumo, // draw
+ Draw // draw
+ };
+
+ //! Type of action.
+ Type type;
+
+ //! Target of action (if applicable).
+ int target;
+
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version) {
+ ar & type;
+ ar & target;
+ }
+};
+
+typedef std::vector<Action> Actions;
+
+#endif