CvPlot::processArea(CvArea *, int)
- Defined in
- CvPlot.cpp, line 10450
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_processArea
Hooks
static bool BeforeCvPlot_processArea(CvPlot* self, CvArea* pArea, int iChange);static void AfterCvPlot_processArea(CvPlot* self, CvArea* pArea, int iChange);static void ReplaceCvPlot_processArea(void (*original)(CvPlot*, CvArea*, int), CvPlot* self, CvArea* pArea, int iChange);CivRegisterBefore<CivHooks::CvPlot_processArea>(host, &BeforeCvPlot_processArea);CivRegisterAfter<CivHooks::CvPlot_processArea>(host, &AfterCvPlot_processArea);CivRegisterReplace<CivHooks::CvPlot_processArea>(host, &ReplaceCvPlot_processArea);
Code
10450void CvPlot::processArea(CvArea* pArea, int iChange)10451{10452 CvCity* pCity;10453 int iI, iJ;1045410455 pArea->changeNumTiles(iChange);1045610457 if(isOwned())10458 {10459 pArea->changeNumOwnedTiles(iChange);10460 }1046110462 if(isNEOfRiver())10463 {10464 pArea->changeNumRiverEdges(iChange);10465 }10466 if(isNWOfRiver())10467 {10468 pArea->changeNumRiverEdges(iChange);10469 }10470 if(isWOfRiver())10471 {10472 pArea->changeNumRiverEdges(iChange);10473 }1047410475 if(getResourceType() != NO_RESOURCE)10476 {10477 pArea->changeNumResources(getResourceType(), iChange);10478 }1047910480 if(getImprovementType() != NO_IMPROVEMENT)10481 {10482 pArea->changeNumImprovements(getImprovementType(), iChange);10483 }1048410485 for(iI = 0; iI < MAX_PLAYERS; ++iI)10486 {10487 if(GET_PLAYER((PlayerTypes)iI).getStartingPlot() == this)10488 {10489 pArea->changeNumStartingPlots(iChange);10490 }1049110492 pArea->changeUnitsPerPlayer(((PlayerTypes)iI), (plotCount(PUF_isPlayer, iI) * iChange));10493 }1049410495 for(iI = 0; iI < MAX_TEAMS; ++iI)10496 {10497 if(isRevealed(((TeamTypes)iI)))10498 {10499 pArea->changeNumRevealedTiles(((TeamTypes)iI), iChange);10500 }10501 }1050210503 pCity = getPlotCity();1050410505 if(pCity != NULL)10506 {10507 // XXX make sure all of this syncs up...10508 pArea->changeCitiesPerPlayer(pCity->getOwner(), iChange);10509 pArea->changePopulationPerPlayer(pCity->getOwner(), (pCity->getPopulation() * iChange));1051010511 for(iI = 0; iI < GC.getNumBuildingInfos(); ++iI)10512 {10513 const BuildingTypes eBuilding = static_cast<BuildingTypes>(iI);10514 CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding);10515 if(pkBuildingInfo)10516 {10517 if(pCity->GetCityBuildings()->GetNumActiveBuilding(eBuilding) > 0)10518 {10519 for(iJ = 0; iJ < NUM_YIELD_TYPES; iJ++)10520 {10521 pArea->changeYieldRateModifier(pCity->getOwner(), ((YieldTypes)iJ), (pkBuildingInfo->GetAreaYieldModifier(iJ) * iChange * pCity->GetCityBuildings()->GetNumActiveBuilding(eBuilding)));10522 }10523 }10524 }10525 }1052610527 for(iI = 0; iI < MAX_PLAYERS; ++iI)10528 {10529 if(pArea->getTargetCity((PlayerTypes)iI) == pCity)10530 {10531 pArea->setTargetCity(((PlayerTypes)iI), NULL);10532 }10533 }10534 }10535}
Calls
- CvArea::changeCitiesPerPlayer(PlayerTypes, int)
- CvArea::changeNumImprovements(ImprovementTypes, int)
- CvArea::changeNumOwnedTiles(int)
- CvArea::changeNumResources(ResourceTypes, int)
- CvArea::changeNumRevealedTiles(TeamTypes, int)
- CvArea::changeNumRiverEdges(int)
- CvArea::changeNumStartingPlots(int)
- CvArea::changeNumTiles(int)
- CvArea::changePopulationPerPlayer(PlayerTypes, int)
- CvArea::changeUnitsPerPlayer(PlayerTypes, int)
- CvArea::changeYieldRateModifier(PlayerTypes, YieldTypes, int)
- CvArea::getTargetCity(PlayerTypes) const
- CvArea::setTargetCity(PlayerTypes, CvCity *)
- CvBuildingEntry::GetAreaYieldModifier(int) const
- CvCity::GetCityBuildings() const
- CvCity::getOwner() const
- CvCity::getPopulation(bool) const
- CvCityBuildings::GetNumActiveBuilding(BuildingTypes) const
- CvGlobals::getBuildingInfo(BuildingTypes)
- CvGlobals::getNumBuildingInfos()
- CvPlayer::getStartingPlot() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvPlot::getImprovementType() const
- CvPlot::getPlotCity() const
- CvPlot::getResourceType(TeamTypes) const
- CvPlot::isNEOfRiver() const
- CvPlot::isNWOfRiver() const
- CvPlot::isOwned() const
- CvPlot::isRevealed(TeamTypes) const
- CvPlot::isWOfRiver() const
- CvPlot::plotCount(ConstPlotUnitFunc, int, int, PlayerTypes, TeamTypes, ConstPlotUnitFunc, int, int) const
- PUF_isPlayer(const CvUnit *, int, int)