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

Method moveToSelectedUnits

bwapi/BWAPI/Source/BWAPI/GameUnits.cpp:526–539  ·  view source on GitHub ↗

------------------------------------------- CENTER ON SELECTED -------------------------------------------

Source from the content-addressed store, hash-verified

524
525 //------------------------------------------- CENTER ON SELECTED -------------------------------------------
526 void GameImpl::moveToSelectedUnits()
527 {
528 // Retrieve the average position of the entire unit set
529 Position pos( this->selectedUnitSet.getPosition() );
530
531 // Move the position to the center of the screen
532 pos -= Position(BW::BWDATA::GameScreenBuffer.width() / 2, BW::BWDATA::GameScreenBuffer.height() / 2 - 40);
533
534 // Make this position a valid position
535 pos.makeValid();
536
537 // Move to the screen position
538 this->setScreenPosition(pos.x, pos.y);
539 }
540
541}
542

Callers 1

CommandFilterFunction · 0.80

Calls 5

setScreenPositionMethod · 0.95
PositionClass · 0.50
getPositionMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected