X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=action.h;h=dd14e28798d0ab83b9370901085e983b1d570195;hp=9b3c9276a105ab8366324c63839ffde92d34d70f;hb=3dadaa088d9fff7ca05cbb297f3d7e88179faccb;hpb=13441470b3b895e08b4165e2154665863f1c3b33 diff --git a/action.h b/action.h index 9b3c927..dd14e28 100644 --- a/action.h +++ b/action.h @@ -3,23 +3,30 @@ #include #include +#include typedef std::vector literals; +typedef std::vector > preconditionsVector; +typedef __gnu_cxx::hash_map effectsMap; class Action { public: - Action(std::string executable, literals preconditions, literals effects); + Action(std::string name, preconditionsVector preconditions, effectsMap effects); Action(const Action& action); Action(){}; - const literals& effects() const; + const literals& effects(int value) const; const literals& preconditions() const; - const std::string& executable() const; + const std::string& name() const; + bool nextExecutable(); int execute() const; + void reset(); protected: - std::string _executable; - literals _preconditions; - literals _effects; + preconditionsVector::const_iterator _currentPrecondition; + std::string _name; + preconditionsVector _preconditions; + effectsMap _effects; + static const literals _empty; }; #endif