#include "node.h"
+using namespace std;
-Node::Node(Action action, std::vector<Node&> children){
+Node::Node(Action action){
_action = action;
- _children = children;
+}
+
+Action Node::action(){
+ return _action;
+}
+
+
+void Node::addChild(Node* node){
+ _children.push_back(node);
+}
+
+
+void Node::execute(){
+ _action.execute();
+
+ for(vector<Node*>::iterator child = _children.begin(); child != _children.end(); ++child){
+ (*child)->execute();
+ }
}