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

Method OnTestFinish

tests/test_unit_command.cc:1265–1285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263 void OnStep() override {}
1264
1265 void OnTestFinish() override {
1266 const ObservationInterface* obs = agent_->Observation();
1267 const Units& target_units = obs->GetUnits(Unit::Alliance::Enemy);
1268
1269 if (target_units.front().is_blip != true) {
1270 ReportError("Target unit is not a blip.");
1271 }
1272 if (target_units.front().cloak != Unit::CloakState::Unknown) {
1273 ReportError("Target unit cloak state is incorrect.");
1274 }
1275 if (target_units.front().display_type != Unit::DisplayType::Hidden) {
1276 ReportError("Target unit is not hidden.");
1277 }
1278 if (target_units.front().owner != 0) {
1279 ReportError("Owner of unit is incorrect.");
1280 }
1281
1282 KillAllUnits();
1283 agent_->Debug()->DebugShowMap();
1284 agent_->Debug()->SendDebug();
1285 }
1286 };
1287
1288

Callers

nothing calls this directly

Calls 5

ObservationMethod · 0.80
GetUnitsMethod · 0.80
DebugShowMapMethod · 0.80
DebugMethod · 0.80
SendDebugMethod · 0.80

Tested by

no test coverage detected