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