| 58 | // |
| 59 | |
| 60 | bool TestMultiplayer(int argc, char** argv) { |
| 61 | static const char* remote_path = "temp_foo.SC2Map"; |
| 62 | |
| 63 | sc2::Coordinator coordinator; |
| 64 | if (!coordinator.LoadSettings(argc, argv)) { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | coordinator.SetMultithreaded(true); |
| 69 | |
| 70 | // Add the custom bot, it will control the players. |
| 71 | MultiplayerTestBot bot1, bot2; |
| 72 | |
| 73 | coordinator.SetParticipants({ |
| 74 | CreateParticipant(sc2::Race::Terran, &bot1), |
| 75 | CreateParticipant(sc2::Race::Terran, &bot2), |
| 76 | }); |
| 77 | |
| 78 | // Start the game. |
| 79 | coordinator.LaunchStarcraft(); |
| 80 | |
| 81 | if (!RemoteSaveMap(coordinator, sc2::kMapBelShirVestigeLE, remote_path)) |
| 82 | return false; |
| 83 | |
| 84 | coordinator.StartGame(remote_path); |
| 85 | |
| 86 | // Step forward the game simulation. |
| 87 | while (!bot1.IsFinished() && !bot2.IsFinished()) { |
| 88 | coordinator.Update(); |
| 89 | } |
| 90 | |
| 91 | return true; |
| 92 | } |
| 93 | |
| 94 | } |
| 95 |
nothing calls this directly
no test coverage detected