MCPcopy Create free account
hub / github.com/Blizzard/s2client-api / IsStructure

Class IsStructure

examples/common/bot_examples.cc:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90};
91
92struct 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
109int CountUnitType(const ObservationInterface* observation, UnitTypeID unit_type) {
110 int count = 0;

Callers 2

TryBuildAddOnMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected