diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 01:33:42 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 01:34:46 +0100 |
commit | a265fcaf73543d028b44a10fbbca2b18979f3845 (patch) | |
tree | 45cabd7e0ebf7318c42197b7e6207917d115251f /common/action.cpp | |
parent | 66940596378b502cf76ad96a5b5a1afb88378454 (diff) |
Check for valid action.
Diffstat (limited to 'common/action.cpp')
-rw-r--r-- | common/action.cpp | 10 |
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(); +} |