MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / addScore

Method addScore

src/Savegame/AlienMission.cpp:609–627  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

607 * @param engine The game engine, required to get access to game data and game rules.
608 */
609void 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.

Callers

nothing calls this directly

Calls 8

getRegionsMethod · 0.80
getSavedGameMethod · 0.80
insideRegionMethod · 0.80
getCountriesMethod · 0.80
insideCountryMethod · 0.80
getRulesMethod · 0.45
addActivityAlienMethod · 0.45
getPointsMethod · 0.45

Tested by

no test coverage detected