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

Class TestBuildGateway

tests/test_unit_command.cc:300–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298 //
299
300 class TestBuildGateway : public TestUnitCommandTargetingPoint {
301 public:
302 TestBuildGateway() {
303 test_unit_type_ = UNIT_TYPEID::PROTOSS_PROBE;
304 test_ability_ = ABILITY_ID::BUILD_GATEWAY;
305 placing_structure_ = true;
306 }
307
308 void SetTestTime() override {
309 wait_game_loops_ = 150;
310 }
311
312 void AdditionalTestSetup() override {
313 target_point_ = GetPointOffsetX(origin_pt_);
314
315 agent_->Debug()->DebugCreateUnit(UNIT_TYPEID::PROTOSS_PYLON, origin_pt_, agent_->Observation()->GetPlayerID(), 1);
316 agent_->Debug()->SendDebug();
317 }
318
319 void OnTestFinish() override {
320 VerifyUnitExistsAndComplete(UNIT_TYPEID::PROTOSS_GATEWAY);
321 VerifyUnitIdleAfterOrder(test_unit_type_);
322 VerifyUnitIdleAfterOrder(UNIT_TYPEID::PROTOSS_GATEWAY);
323 const ObservationInterface* obs = agent_->Observation();
324 if (obs->GetWarpGateCount() != 0) {
325 ReportError("Gateway is being incorrectly identified as a Warp Gate.");
326 }
327 KillAllUnits();
328 }
329 };
330
331
332 //

Callers 1

UnitCommandTestBotMethod · 0.85

Calls

no outgoing calls

Tested by 1

UnitCommandTestBotMethod · 0.68