X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=node.cpp;h=ed72a7f60c5a5e289c33fe36592a715d4ec29cc1;hp=4f81069e111eaf55e603c2bfd26b9a312eef216d;hb=498b277372ebab0008b97399d387285b36d88826;hpb=b177aeec472c3941b39b874a83883ff87a41919c diff --git a/node.cpp b/node.cpp index 4f81069..ed72a7f 100644 --- a/node.cpp +++ b/node.cpp @@ -1,4 +1,5 @@ #include "node.h" +using namespace std; Node::Node(Action action){ _action = action; @@ -13,3 +14,11 @@ void Node::addChild(Node* node){ _children.push_back(node); } + +void Node::execute(){ + _action.execute(); + + for(vector::iterator child = _children.begin(); child != _children.end(); ++child){ + (*child)->execute(); + } +}