]> ruin.nu Git - popboot.git/blobdiff - action.h
not working
[popboot.git] / action.h
index 60206a391c76119853c3beaf9fbde219f2f284c8..dd14e28798d0ab83b9370901085e983b1d570195 100644 (file)
--- a/action.h
+++ b/action.h
@@ -1,19 +1,32 @@
 #ifndef __ACTION_H__
 #define __ACTION_H__
 
-typedef literals std::vector<string>;
+#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);
-               const literals effects() const;
-               const literals preconditions() const;
+               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;
-               literals _preconditions;
-               literals _effects;
+               preconditionsVector::const_iterator _currentPrecondition;
+               std::string _name;
+               preconditionsVector _preconditions;
+               effectsMap _effects;
+               static const literals _empty;
 };
 
 #endif