| 90 | }; |
| 91 | |
| 92 | struct IsStructure { |
| 93 | IsStructure(const ObservationInterface* obs) : observation_(obs) {}; |
| 94 | |
| 95 | bool operator()(const Unit& unit) { |
| 96 | auto& attributes = observation_->GetUnitTypeData().at(unit.unit_type).attributes; |
| 97 | bool is_structure = false; |
| 98 | for (const auto& attribute : attributes) { |
| 99 | if (attribute == Attribute::Structure) { |
| 100 | is_structure = true; |
| 101 | } |
| 102 | } |
| 103 | return is_structure; |
| 104 | } |
| 105 | |
| 106 | const ObservationInterface* observation_; |
| 107 | }; |
| 108 | |
| 109 | int CountUnitType(const ObservationInterface* observation, UnitTypeID unit_type) { |
| 110 | int count = 0; |
no outgoing calls
no test coverage detected