From a265fcaf73543d028b44a10fbbca2b18979f3845 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 25 Nov 2010 01:33:42 +0100 Subject: Check for valid action. --- common/action.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/action.cpp (limited to 'common/action.cpp') diff --git a/common/action.cpp b/common/action.cpp new file mode 100644 index 0000000..467df4e --- /dev/null +++ b/common/action.cpp @@ -0,0 +1,10 @@ +#include "action.h" +#include + +bool Action::operator==(Action other) { + return type == other.type && target == other.target; +} + +bool Actions::contains(Action action) { + return std::find(begin(), end(), action) != end(); +} -- cgit v1.2.3