X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=node.h;h=272bee93bc565977f03a9499f8d02f8255ed7831;hp=0d9cae6fa0229ce432dfb21497452adfa2075e16;hb=d385ba13a2ded8ce22b83c82d8a50c89a5d1d63e;hpb=09f6dfa65b66103c27dc831271d961de9ab0109e diff --git a/node.h b/node.h index 0d9cae6..272bee9 100644 --- a/node.h +++ b/node.h @@ -2,20 +2,41 @@ #define __node_h__ #include +#include #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(const Literals& effects); + bool executed() const; + const Literals& effects() const; + void satisfyCondition(std::string effect); protected: - Action _action; + const Action* _action; std::vector _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