| 18 | {} |
| 19 | |
| 20 | void Town::AddUnit(BWAPI::Unit pUnit) |
| 21 | { |
| 22 | if ( !pUnit ) |
| 23 | return; |
| 24 | |
| 25 | if ( pUnit->getType().isWorker() ) |
| 26 | { |
| 27 | // New Worker |
| 28 | UnitWrap(pUnit).SetControlType(ControlTypes::Worker); |
| 29 | } |
| 30 | else if ( (IsBuilding || GetType == UnitTypes::Zerg_Egg || GetType == UnitTypes::Zerg_Larva || GetType == UnitTypes::Zerg_Overlord)(pUnit) ) |
| 31 | { |
| 32 | // New Task |
| 33 | |
| 34 | // Something make guard |
| 35 | |
| 36 | // |
| 37 | if ( pUnit->getType().isResourceDepot() ) |
| 38 | { |
| 39 | if ( !this->pTownCenter ) |
| 40 | this->pTownCenter = pUnit; |
| 41 | } |
| 42 | else if ( pUnit->getType().isRefinery() ) |
| 43 | { |
| 44 | this->gasGeysers.insert(pUnit); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 |
nothing calls this directly
no test coverage detected