]> ruin.nu Git - popboot.git/blob - node.h
delete remaining actions
[popboot.git] / node.h
1 #ifndef __node_h__
2 #define __node_h__
3
4 #include <vector>
5 #include <utility>
6 #include "action.h"
7
8 class Node {
9
10         public:
11                 Node(const Action* action);
12                 Node();
13                 Node(const Node& node);
14                 virtual ~Node(){}
15                 void addChild(Node* node);
16                 const Action* action() const;
17                 void execute(const Literals& effects);
18                 bool executed() const;
19                 const Literals& effects() const;
20                 void satisfyCondition(std::string effect);
21
22         protected:
23                 const Action* _action;
24                 std::vector<Node*> _children;
25                 Preconditions _preconditions;
26                 bool _executed;
27                 Literals _effects;
28 };
29
30 class StartNode :public Node {
31         public:
32                 StartNode(const Literals& init);
33                 ~StartNode(){delete _action;}
34 };
35
36 class EndNode :public Node {
37         public:
38                 EndNode(const Literals& goal);
39                 ~EndNode(){delete _action;}
40 };
41
42 #endif