From 92df3471557a1e8c51a93d0b6663a2e719055fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atle=20Hellvik=20Havs=C3=B8?= Date: Mon, 22 Nov 2010 12:57:12 +0100 Subject: Added a Set class. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Atle Hellvik Havsø --- common/set.cpp | 5 +++++ common/set.h | 21 +++++++++++++++++++++ common/tile.h | 2 ++ 3 files changed, 28 insertions(+) create mode 100644 common/set.cpp create mode 100644 common/set.h 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 void serialize(Archive & ar, const unsigned int version) { ar & type; -- cgit v1.2.3