summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtle Hellvik Havsø <atle@havso.net>2010-11-22 12:57:12 +0100
committerAtle Hellvik Havsø <atle@havso.net>2010-11-22 12:57:12 +0100
commit92df3471557a1e8c51a93d0b6663a2e719055fda (patch)
tree3482f8a35c199a9d4a5f79764c26026ae99a27b2
parent9a2d4a69e13b344d4342af3c81373ac14eeb0368 (diff)
Added a Set class.
Signed-off-by: Atle Hellvik Havsø <atle@havso.net>
-rw-r--r--common/set.cpp5
-rw-r--r--common/set.h21
-rw-r--r--common/tile.h2
3 files changed, 28 insertions, 0 deletions
diff --git a/common/set.cpp b/common/set.cpp
new file mode 100644
index 0000000..ce44f02
--- /dev/null
+++ b/common/set.cpp
@@ -0,0 +1,5 @@
+#include "set.h"
+
+void Set::add_tile(Tile tile) {
+ container.push_back(tile);
+}
diff --git a/common/set.h b/common/set.h
new file mode 100644
index 0000000..3f762eb
--- /dev/null
+++ b/common/set.h
@@ -0,0 +1,21 @@
+#ifndef CHI_H
+#define CHI_H
+
+#include "tile.h"
+
+//! Contains a set of tiles
+class Set : public Tile {
+ private:
+ Tiles container;
+
+ public:
+ Set(){};
+ virtual ~Chi(){};
+
+ //! Add a tile to the set
+ //! \param tile The tile that should be added to the set
+ void add_tile(Tile tile);
+};
+
+
+#endif // CHI_H
diff --git a/common/tile.h b/common/tile.h
index 14fe8c1..6f83632 100644
--- a/common/tile.h
+++ b/common/tile.h
@@ -57,6 +57,8 @@ class Tile {
Tile();
Tile(Type t, bool re = false, bool ro = false);
+ virtual ~Tile(){};
+
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
ar & type;