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

Method OnStep

tests/test_unit_command_common.cc:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 void TestUnitCommand::OnStep() {
26 const ObservationInterface* obs = agent_->Observation();
27 ActionInterface* act = agent_->Actions();
28
29 if (obs->GetGameLoop() < order_on_game_loop_) {
30 return;
31 }
32
33 test_units_ = obs->GetUnits(Unit::Self, [&](const Unit& unit) {
34 return unit.unit_type == test_unit_type_;
35 });
36
37 if (test_units_.size() > 0) {
38 test_unit_ = test_units_.front();
39 }
40
41 IssueUnitCommand(act);
42 }
43
44 void TestUnitCommand::OnTestFinish() {
45 VerifyUnitIdleAfterOrder(test_unit_type_);

Callers

nothing calls this directly

Calls 4

ObservationMethod · 0.80
ActionsMethod · 0.80
GetGameLoopMethod · 0.80
GetUnitsMethod · 0.80

Tested by

no test coverage detected