X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=node.h;h=272bee93bc565977f03a9499f8d02f8255ed7831;hp=77a9d7bbefce9d7265d870e2f80c9b5fb400dfc7;hb=d385ba13a2ded8ce22b83c82d8a50c89a5d1d63e;hpb=dc4211bc1dc77ba3f1a71ec5737c61731614004b diff --git a/node.h b/node.h index 77a9d7b..272bee9 100644 --- a/node.h +++ b/node.h @@ -8,19 +8,19 @@ 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; + 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; Preconditions _preconditions; bool _executed; @@ -30,11 +30,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