From 0cdc2b7ab4dadb744c6b4823acbc5fe039b29f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 9 Jan 2013 18:42:17 +0100 Subject: [PATCH] Rack: add operator==() --- game/rack.cpp | 8 ++++++++ game/rack.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/game/rack.cpp b/game/rack.cpp index 5cee9fd..5296c96 100644 --- a/game/rack.cpp +++ b/game/rack.cpp @@ -79,3 +79,11 @@ wstring Rack::toString() const return rs; } + +bool Rack::operator==(const Rack &iOther) const +{ + return m_tiles == iOther.m_tiles + && m_ntiles == iOther.m_ntiles; +} + + diff --git a/game/rack.h b/game/rack.h index 5c54136..0fa280b 100644 --- a/game/rack.h +++ b/game/rack.h @@ -52,6 +52,8 @@ public: wstring toString() const; + bool operator==(const Rack &iOther) const; + private: /// Vector indexed by tile codes, containing the number of tiles vector m_tiles;