]> ruin.nu Git - popboot.git/blobdiff - node.cpp
initial execution of the plan
[popboot.git] / node.cpp
index 11fed08507b52bfe5953a1558aed3c3e2be6818a..ed72a7f60c5a5e289c33fe36592a715d4ec29cc1 100644 (file)
--- a/node.cpp
+++ b/node.cpp
@@ -1,5 +1,24 @@
 #include "node.h"
+using namespace std;
 
 Node::Node(Action action){
        _action = action;
 }
+
+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();
+       }
+}