From 70ca1e294fe9e8b23bd45bea7db4a2574698f1fa Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 11 Dec 2010 07:17:00 +0100 Subject: Added Tile::is_simple(). --- common/tile.cpp | 5 +++++ common/tile.h | 3 +++ 2 files changed, 8 insertions(+) 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; -- cgit v1.2.3