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

Method VerifyUnitOrders

tests/test_unit_command_common.cc:84–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void TestUnitCommand::VerifyUnitOrders(Tag unit_tag, ABILITY_ID test_ability) {
85 bool order_found = false;
86
87 const ObservationInterface* obs = agent_->Observation();
88 if (!obs) {
89 return;
90 }
91
92 const Unit* unit = obs->GetUnit(unit_tag);
93 if (!unit) {
94 return;
95 }
96
97 for (UnitOrder order : unit->orders) {
98 if (order.ability_id == test_ability) {
99 order_found = true;
100 }
101 }
102
103 if (!order_found) {
104 ReportError("Expected order not in unit orders");
105 }
106
107 orders_verified_ = true;
108 }
109
110 void TestUnitCommand::VerifyUnitExistsAndComplete(UNIT_TYPEID unit_type, bool verify_complete) {
111 bool unit_exists = false;

Callers

nothing calls this directly

Calls 2

ObservationMethod · 0.80
GetUnitMethod · 0.80

Tested by

no test coverage detected