]> ruin.nu Git - popboot.git/blobdiff - node.h
including iterator
[popboot.git] / node.h
diff --git a/node.h b/node.h
index 0d9cae6fa0229ce432dfb21497452adfa2075e16..cbe17348aa103a1befce5a11baca11391b28f424 100644 (file)
--- a/node.h
+++ b/node.h
@@ -2,20 +2,44 @@
 #define __node_h__
 
 #include <vector>
+#include <utility>
 #include "action.h"
 
 class Node {
 
        public:
-               Node(Action action);
+               Node(const Action* action);
+               Node();
+               Node(const Node& node);
+               virtual ~Node(){}
                void addChild(Node* node);
-               Action action();
-               void execute(literals effects);
+               const Action* action() const;
+               void execute();
+               bool executed() const;
+               const Literals& effects() const;
+               bool satisfyCondition(std::string effect);
+               bool satisfyConditions(const Literals& effects);
+               const std::vector<Node*>& children() const;
+               const Preconditions& preconditions() const;
 
        protected:
-               Action _action;
+               const Action* _action;
                std::vector<Node*> _children;
-               literals _preconditions;
+               Preconditions _preconditions;
+               bool _executed;
+               Literals _effects;
+};
+
+class StartNode :public Node {
+       public:
+               StartNode(const Literals& init);
+               ~StartNode(){delete _action;}
+};
+
+class EndNode :public Node {
+       public:
+               EndNode(const Literals& goal);
+               ~EndNode(){delete _action;}
 };
 
 #endif