------------------------------------------- CENTER ON SELECTED -------------------------------------------
| 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 |
no test coverage detected