Advertisement
skatsner

Untitled

Apr 27th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #include "Interface.h"
  2. #include "RobotDB.h"
  3. #include "Printer.h"
  4. #include <string>
  5. #include <vector>
  6.  
  7. /** this module has the function that has the connection with the user and activates all
  8. the other functions .it uses map.h and roborDB.h in order to use these functions. **/
  9.  
  10.  
  11. using namespace std;
  12.  
  13. /** this i the function that get the input from the user using standart input , and acording
  14. to the order it get the right parameters that needed from the user ,
  15. calls to the right function to make the order happen. **/
  16. void StartControl()
  17. {
  18. string Order;
  19. string RobotName;
  20. string Direction;
  21. int x, y;
  22. cout << "Start entering commands:" << std::endl;
  23. while (cin>>Order)
  24. {
  25.  
  26. if (Order=="Move")
  27. {
  28. cin>>RobotName;
  29. cin>>Direction;
  30. Move_Robot(RobotName, Direction);
  31.  
  32. }
  33. else if (Order=="addDirt")
  34. {
  35. cin>>x;
  36. cin>>y;
  37. addDirt(x,y);
  38. }
  39. else if (Order=="Clean")
  40. {
  41. cin>>RobotName;
  42. Clean(RobotName);
  43. }
  44. else if (Order=="Place")
  45. {
  46. cin>>RobotName;
  47. cin>>x;
  48. cin>>y;
  49. Place_Robot(RobotName, x, y);
  50. }
  51.  
  52. else if (Order=="Delete")
  53. {
  54. cin>>RobotName;
  55. Delete_Robot(RobotName);
  56. }
  57. else if (Order=="MoveMulti") {
  58.  
  59. cin>>RobotName;
  60. cin >> Direction;
  61. while (Direction != "end") {
  62. Move_Robot(RobotName, Direction);
  63. cin >> Direction;
  64. }
  65. }
  66. }
  67. PrintTable(RobotNames,Ranks,Tanks);
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement