]> ruin.nu Git - popboot.git/blobdiff - action.h
not working
[popboot.git] / action.h
index 9b3c9276a105ab8366324c63839ffde92d34d70f..dd14e28798d0ab83b9370901085e983b1d570195 100644 (file)
--- a/action.h
+++ b/action.h
@@ -3,23 +3,30 @@
 
 #include <vector>
 #include <string>
+#include <ext/hash_map>
 
 typedef std::vector<std::string> literals;
+typedef std::vector<std::pair<std::string,literals> > preconditionsVector;
+typedef __gnu_cxx::hash_map<int,literals> 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