MCPcopy Create free account
hub / github.com/Blizzard/s2client-api / TestUnitCommand

Function TestUnitCommand

tests/test_unit_command.cc:1803–1826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1801//
1802
1803bool TestUnitCommand(int argc, char** argv) {
1804 Coordinator coordinator;
1805 if (!coordinator.LoadSettings(argc, argv)) {
1806 return false;
1807 }
1808
1809 // Add the custom bot, it will control the players.
1810 UnitCommandTestBot bot;
1811
1812 coordinator.SetParticipants({
1813 CreateParticipant(sc2::Race::Terran, &bot),
1814 });
1815
1816 // Start the game.
1817 coordinator.LaunchStarcraft();
1818 coordinator.StartGame(sc2::kMapEmpty);
1819
1820 // Step forward the game simulation.
1821 while (!bot.IsFinished()) {
1822 coordinator.Update();
1823 }
1824
1825 return bot.Success();
1826}
1827
1828}
1829

Callers

nothing calls this directly

Calls 8

CreateParticipantFunction · 0.85
LoadSettingsMethod · 0.80
SetParticipantsMethod · 0.80
LaunchStarcraftMethod · 0.80
StartGameMethod · 0.80
UpdateMethod · 0.80
SuccessMethod · 0.80
IsFinishedMethod · 0.45

Tested by

no test coverage detected