summaryrefslogtreecommitdiff
path: root/common/action.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 01:33:42 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 01:34:46 +0100
commita265fcaf73543d028b44a10fbbca2b18979f3845 (patch)
tree45cabd7e0ebf7318c42197b7e6207917d115251f /common/action.cpp
parent66940596378b502cf76ad96a5b5a1afb88378454 (diff)
Check for valid action.
Diffstat (limited to 'common/action.cpp')
-rw-r--r--common/action.cpp10
1 files changed, 10 insertions, 0 deletions
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 <algorithm>
+
+bool Action::operator==(Action other) {
+ return type == other.type && target == other.target;
+}
+
+bool Actions::contains(Action action) {
+ return std::find(begin(), end(), action) != end();
+}