MCPcopy Create free account
hub / github.com/bwapi/bwapi / useTech

Method useTech

bwapi/BWAPILIB/UnitCommand.cpp:243–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 return UnitCommand{ unit, UnitCommandTypes::Cancel_Upgrade };
242 }
243 UnitCommand UnitCommand::useTech(Unit unit, TechType tech)
244 {
245 UnitCommand c{ unit, UnitCommandTypes::Use_Tech };
246 c.extra = tech;
247 if ( tech == TechTypes::Burrowing )
248 c.type = unit->isBurrowed() ? UnitCommandTypes::Unburrow : UnitCommandTypes::Burrow;
249 else if ( tech == TechTypes::Cloaking_Field || tech == TechTypes::Personnel_Cloaking )
250 c.type = unit->isCloaked() ? UnitCommandTypes::Decloak : UnitCommandTypes::Cloak;
251 else if ( tech == TechTypes::Tank_Siege_Mode )
252 c.type = unit->isSieged() ? UnitCommandTypes::Unsiege : UnitCommandTypes::Siege;
253 return c;
254 }
255 UnitCommand UnitCommand::useTech(Unit unit, TechType tech, Position target)
256 {
257 UnitCommand c{ unit, UnitCommandTypes::Use_Tech_Position };

Callers 2

executeMethod · 0.45
UseTechMethod · 0.45

Calls 4

isBurrowedMethod · 0.80
isCloakedMethod · 0.80
isSiegedMethod · 0.80
assignTargetMethod · 0.80

Tested by

no test coverage detected