From 86ed14f75e23b600e3771f5aee7aaec12997315e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Sun, 30 Dec 2012 16:13:45 +0100 Subject: [PATCH] Move: add operator==() --- game/move.cpp | 12 ++++++++++++ game/move.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/game/move.cpp b/game/move.cpp index 47d2275..67fe724 100644 --- a/game/move.cpp +++ b/game/move.cpp @@ -163,3 +163,15 @@ wstring Move::toString() const return wss.str(); } + +bool Move::operator==(const Move &iOther) const +{ + return m_type == iOther.m_type + && m_score == iOther.m_score + && m_word == iOther.m_word + && m_coord == iOther.m_coord + && m_letters == iOther.m_letters + && m_round == iOther.m_round; +} + + diff --git a/game/move.h b/game/move.h index ea41ee5..5fd3a46 100644 --- a/game/move.h +++ b/game/move.h @@ -121,6 +121,9 @@ class Move /// To help debugging wstring toString() const; + /// Equality operator + bool operator==(const Move &iOther) const; + private: enum Type