* Add alien points to the country and region at the coordinates given. * @param lon Longitudinal coordinates to check. * @param lat Latitudinal coordinates to check. * @param engine The game engine, required to get access to game data and game rules. */
| 607 | * @param engine The game engine, required to get access to game data and game rules. |
| 608 | */ |
| 609 | void AlienMission::addScore(const double lon, const double lat, Game &engine) |
| 610 | { |
| 611 | for (std::vector<Region *>::iterator region = engine.getSavedGame()->getRegions()->begin(); region != engine.getSavedGame()->getRegions()->end(); ++region) |
| 612 | { |
| 613 | if ((*region)->getRules()->insideRegion(lon, lat)) |
| 614 | { |
| 615 | (*region)->addActivityAlien(_rule.getPoints()); |
| 616 | break; |
| 617 | } |
| 618 | } |
| 619 | for (std::vector<Country *>::iterator country = engine.getSavedGame()->getCountries()->begin(); country != engine.getSavedGame()->getCountries()->end(); ++country) |
| 620 | { |
| 621 | if ((*country)->getRules()->insideCountry(lon, lat)) |
| 622 | { |
| 623 | (*country)->addActivityAlien(_rule.getPoints()); |
| 624 | break; |
| 625 | } |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | /** |
| 630 | * Spawn an alien base. |
nothing calls this directly
no test coverage detected