summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-11 07:17:00 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-11 07:17:00 +0100
commit70ca1e294fe9e8b23bd45bea7db4a2574698f1fa (patch)
tree7c3ce4b881c73127d1ad7464097b164d99389744 /common
parent23c497886ebfbe95dbffa9320de4340d7a7445c9 (diff)
Added Tile::is_simple().
Diffstat (limited to 'common')
-rw-r--r--common/tile.cpp5
-rw-r--r--common/tile.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/common/tile.cpp b/common/tile.cpp
index 4b7e3ef..4b1f8b5 100644
--- a/common/tile.cpp
+++ b/common/tile.cpp
@@ -43,6 +43,11 @@ Tile::Set Tile::get_set() const {
}
}
+bool Tile::is_simple() const {
+ int n = get_num();
+ return n > 1 && n < 9;
+}
+
bool Tile::operator==(const Tile& other) const {
return type == other.type;
}
diff --git a/common/tile.h b/common/tile.h
index df3ea76..83ec10b 100644
--- a/common/tile.h
+++ b/common/tile.h
@@ -75,6 +75,9 @@ class Tile {
//! Get the set type of the tile (if one of the man/pin/sou-sets).
Set get_set() const;
+ //! Check if the tile is one of the simples (e.g. 2-8).
+ bool is_simple() const;
+
//! Compare two tiles. Equal if type matches; flags are not compared.
bool operator==(const Tile& other) const;