X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=node.h;h=cbe17348aa103a1befce5a11baca11391b28f424;hb=e68f7a74e8f83d4b619049cf0e67f7de5e03cf82;hp=b49d0109ee042005010a2bae4eb455395db8b57c;hpb=c9c72023d15decebe700ad0bfe3e8cbac9a85248;p=popboot.git diff --git a/node.h b/node.h index b49d010..cbe1734 100644 --- a/node.h +++ b/node.h @@ -8,18 +8,22 @@ class Node { public: - Node(const Action& action); + Node(const Action* action); Node(); Node(const Node& node); virtual ~Node(){} void addChild(Node* node); - const Action& action() const; - void execute(const 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& children() const; + const Preconditions& preconditions() const; protected: - Action _action; + const Action* _action; std::vector _children; Preconditions _preconditions; bool _executed; @@ -29,11 +33,13 @@ class Node { 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