X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=node.h;h=669657dd3e8ae373850e5c7967d9db6a3fbb6cbe;hb=3f82360c5e0c61eccacdbaf3bd077852b9326f34;hp=27a95c49b6db4048f251845ac599eef381dc5a4d;hpb=50f9b29fed8c97deac825a31c35bb7759abca04f;p=popboot.git diff --git a/node.h b/node.h index 27a95c4..669657d 100644 --- a/node.h +++ b/node.h @@ -2,12 +2,43 @@ #define __node_h__ #include +#include +#include "action.h" class Node { + public: + Node(const Action* action); + Node(); + Node(const Node& node); + virtual ~Node(){} + void addChild(Node* node); + 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; + protected: - Action action; - std::vector children; + const Action* _action; + std::vector _children; + 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