| 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 }; |
no test coverage detected