MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / start

Method start

src/bzrobots/RobotScript.cpp:69–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void 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
89void RobotScript::stop() {
90#ifndef _WIN32

Callers 1

handleNewPlayerFunction · 0.45

Calls 3

setCallbacksMethod · 0.80
setRobotMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected