Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Interface.h"
- #include "RobotDB.h"
- #include "Printer.h"
- #include <string>
- #include <vector>
- /** this module has the function that has the connection with the user and activates all
- the other functions .it uses map.h and roborDB.h in order to use these functions. **/
- using namespace std;
- /** this i the function that get the input from the user using standart input , and acording
- to the order it get the right parameters that needed from the user ,
- calls to the right function to make the order happen. **/
- void StartControl()
- {
- string Order;
- string RobotName;
- string Direction;
- int x, y;
- cout << "Start entering commands:" << std::endl;
- while (cin>>Order)
- {
- if (Order=="Move")
- {
- cin>>RobotName;
- cin>>Direction;
- Move_Robot(RobotName, Direction);
- }
- else if (Order=="addDirt")
- {
- cin>>x;
- cin>>y;
- addDirt(x,y);
- }
- else if (Order=="Clean")
- {
- cin>>RobotName;
- Clean(RobotName);
- }
- else if (Order=="Place")
- {
- cin>>RobotName;
- cin>>x;
- cin>>y;
- Place_Robot(RobotName, x, y);
- }
- else if (Order=="Delete")
- {
- cin>>RobotName;
- Delete_Robot(RobotName);
- }
- else if (Order=="MoveMulti") {
- cin>>RobotName;
- cin >> Direction;
- while (Direction != "end") {
- Move_Robot(RobotName, Direction);
- cin >> Direction;
- }
- }
- }
- PrintTable(RobotNames,Ranks,Tanks);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement