-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManager.cpp
More file actions
42 lines (36 loc) · 711 Bytes
/
Manager.cpp
File metadata and controls
42 lines (36 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Manager.cpp
*
* Created on: Jan 7, 2016
* Author: user
*/
#include "Manager.h"
Manager::Manager(Robot* robot, Plan* plan) {
_robot= robot;
_plan = plan;
}
void Manager::run()
{
Behavior* currBeh = _plan->getStart();
_robot->read();
if(!(currBeh->startCond()))
{
cout<<"x:"<<_robot->getXPosition()<<"y:"<<_robot->getYPosition()<<endl;
return;
}
while(currBeh)
{
_robot->read();
cout << "changing behavior" << endl;
while(!(currBeh->stopCond()))
{
cout<<"x:"<<_robot->getXPosition()<<"y:"<<_robot->getYPosition()<<endl;
currBeh->action();
_robot->read();
}
currBeh = currBeh->getNext();
}
}
Manager::~Manager() {
// TODO Auto-generated destructor stub
}