-------------------------------------- UNIT TYPE REQUIREMENT ---------------------------------------------
| 145 | } |
| 146 | //-------------------------------------- UNIT TYPE REQUIREMENT --------------------------------------------- |
| 147 | bool PlayerInterface::hasUnitTypeRequirement(UnitType unit, int amount) const |
| 148 | { |
| 149 | if (unit == UnitTypes::None) |
| 150 | return true; |
| 151 | |
| 152 | switch (unit) |
| 153 | { |
| 154 | case UnitTypes::Enum::Zerg_Hatchery: |
| 155 | return completedUnitCount(UnitTypes::Zerg_Hatchery) + allUnitCount(UnitTypes::Zerg_Lair) + allUnitCount(UnitTypes::Zerg_Hive) >= amount; |
| 156 | case UnitTypes::Enum::Zerg_Lair: |
| 157 | return completedUnitCount(UnitTypes::Zerg_Lair) + allUnitCount(UnitTypes::Zerg_Hive) >= amount; |
| 158 | case UnitTypes::Enum::Zerg_Spire: |
| 159 | return completedUnitCount(UnitTypes::Zerg_Spire) + allUnitCount(UnitTypes::Zerg_Greater_Spire) >= amount; |
| 160 | default: |
| 161 | return completedUnitCount(unit) >= amount; |
| 162 | } |
| 163 | } |
no outgoing calls
no test coverage detected