From 8809e34f9d9241c39ee067de25d968bea887783f Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 25 Nov 2010 11:12:43 +0100 Subject: Add Action() taking type and target and Actions::operator bool(). --- common/action.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common/action.cpp') 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 +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(); } -- cgit v1.2.3