diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/tile.cpp | 5 | ||||
-rw-r--r-- | common/tile.h | 3 |
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; |