| 1245 | // |
| 1246 | |
| 1247 | class TestSensorTower : public TestUnitCommand { |
| 1248 | public: |
| 1249 | TestSensorTower() { |
| 1250 | test_unit_type_ = UNIT_TYPEID::TERRAN_SENSORTOWER; |
| 1251 | } |
| 1252 | |
| 1253 | void SetTestTime() override { |
| 1254 | wait_game_loops_ = 50; |
| 1255 | } |
| 1256 | |
| 1257 | void AdditionalTestSetup() override { |
| 1258 | agent_->Debug()->DebugCreateUnit(UNIT_TYPEID::ZERG_MUTALISK, GetPointOffsetX(origin_pt_, 25), agent_->Observation()->GetPlayerID() + 1, 1); |
| 1259 | agent_->Debug()->DebugShowMap(); |
| 1260 | agent_->Debug()->SendDebug(); |
| 1261 | } |
| 1262 | |
| 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 | |
| 1289 | // |
no outgoing calls