diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 11:12:43 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-25 11:12:43 +0100 |
commit | 8809e34f9d9241c39ee067de25d968bea887783f (patch) | |
tree | 4be6de2d80936bed35ac1d386db71b3dd3cda747 /common/action.cpp | |
parent | fa8f99cb63cd04bb8006e3f568d7f2494723528f (diff) |
Add Action() taking type and target and Actions::operator bool().
Diffstat (limited to 'common/action.cpp')
-rw-r--r-- | common/action.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/action.cpp b/common/action.cpp index 188535e..58b7392 100644 --- a/common/action.cpp +++ b/common/action.cpp @@ -1,10 +1,22 @@ #include "action.h" #include <algorithm> +Action::Action() { + +} + +Action::Action(Type ty, int ta) : type(ty), target(ta) { + +} + bool Action::operator==(const Action& other) { return type == other.type && target == other.target; } +Actions::operator bool() { + return !empty(); +} + bool Actions::contains(Action action) { return std::find(begin(), end(), action) != end(); } |