diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 11:14:12 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 11:14:12 +0100 |
commit | 2491b378a650e152522818543e375ae8339f128c (patch) | |
tree | 143ba5f6f8d2b343cd8dbb8706d26d6a9443f55b /common/tile.h | |
parent | 8809e34f9d9241c39ee067de25d968bea887783f (diff) |
Add get_set() to Tile.
Diffstat (limited to 'common/tile.h')
-rw-r--r-- | common/tile.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/tile.h b/common/tile.h index 84552aa..90e25dc 100644 --- a/common/tile.h +++ b/common/tile.h @@ -51,18 +51,34 @@ class Tile { Hatsu }; + enum Set { + Honor, + Man, + Pin, + Sou + }; + Type type; bool red; bool rotated; + //! Default constructor. Tile(); + + //! Construct tile by type. Tile(Type t, bool re = false, bool ro = false); + //! Construct tile by set and number. + Tile(Set s, int num, bool re = false, bool ro = false); + virtual ~Tile(){}; //! Get the numeric value of the tile (if one of the man/pin/sou-sets). int get_num() const; + //! Get the set type of the tile (if one of the man/pin/sou-sets). + Set get_set() const; + //! Compare two tiles. Equal if type matches; flags are not compared. bool operator==(const Tile& other) const; |