| 67 | } |
| 68 | |
| 69 | void RobotScript::start() { |
| 70 | if (!robot) { |
| 71 | robot = create(); |
| 72 | } |
| 73 | if (robot) { |
| 74 | robot->setCallbacks(bzrobotcb); |
| 75 | } |
| 76 | if (botplayer) { |
| 77 | botplayer->setRobot(robot); |
| 78 | } |
| 79 | |
| 80 | #ifndef _WIN32 |
| 81 | pthread_create(&rthread, NULL, startBot, robot); |
| 82 | #else |
| 83 | rthread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) startBot, robot, 0, 0); |
| 84 | #endif // _WIN32 |
| 85 | |
| 86 | _running = true; |
| 87 | } |
| 88 | |
| 89 | void RobotScript::stop() { |
| 90 | #ifndef _WIN32 |
no test coverage detected