| 1206 | } |
| 1207 | |
| 1208 | bool ProtossMultiplayerBot::TryBuildProbe() { |
| 1209 | const ObservationInterface* observation = Observation(); |
| 1210 | Units bases = observation->GetUnits(Unit::Alliance::Self, IsTownHall()); |
| 1211 | if (observation->GetFoodWorkers() >= max_worker_count_) { |
| 1212 | return false; |
| 1213 | } |
| 1214 | |
| 1215 | if (observation->GetFoodUsed() >= observation->GetFoodCap()) { |
| 1216 | return false; |
| 1217 | } |
| 1218 | |
| 1219 | if (observation->GetFoodWorkers() > GetExpectedWorkers(UNIT_TYPEID::PROTOSS_ASSIMILATOR)) { |
| 1220 | return false; |
| 1221 | } |
| 1222 | |
| 1223 | for (const auto& base : bases) { |
| 1224 | //if there is a base with less than ideal workers |
| 1225 | if (base.assigned_harvesters < base.ideal_harvesters && base.build_progress == 1) { |
| 1226 | if (observation->GetMinerals() >= 50) { |
| 1227 | return TryBuildUnit(ABILITY_ID::TRAIN_PROBE, UNIT_TYPEID::PROTOSS_NEXUS); |
| 1228 | } |
| 1229 | } |
| 1230 | } |
| 1231 | return false; |
| 1232 | } |
| 1233 | |
| 1234 | void ProtossMultiplayerBot::OnStep() { |
| 1235 |
nothing calls this directly
no test coverage detected