CvPlot::isCoastalLand(int) const
- Defined in
- CvPlot.cpp, line 1070
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_isCoastalLand
Hooks
static bool BeforeCvPlot_isCoastalLand(const CvPlot* self, int iMinWaterSize, bool& result);static void AfterCvPlot_isCoastalLand(const CvPlot* self, int iMinWaterSize, bool& result);static bool ReplaceCvPlot_isCoastalLand(bool (*original)(const CvPlot*, int), const CvPlot* self, int iMinWaterSize);CivRegisterBefore<CivHooks::CvPlot_isCoastalLand>(host, &BeforeCvPlot_isCoastalLand);CivRegisterAfter<CivHooks::CvPlot_isCoastalLand>(host, &AfterCvPlot_isCoastalLand);CivRegisterReplace<CivHooks::CvPlot_isCoastalLand>(host, &ReplaceCvPlot_isCoastalLand);
Code
1070bool CvPlot::isCoastalLand(int iMinWaterSize) const1071{1072 CvPlot* pAdjacentPlot;1073 int iI;10741075 if(isWater())1076 {1077 return false;1078 }10791080 // If -1 was passed in (default argument) use min water size for ocean define1081 if(iMinWaterSize == -1)1082 {1083 iMinWaterSize = GC.getMIN_WATER_SIZE_FOR_OCEAN();1084 }10851086 for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)1087 {1088 pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));10891090 if(pAdjacentPlot != NULL)1091 {1092 if(pAdjacentPlot->isWater())1093 {1094 if(iMinWaterSize <= 0)1095 {1096 return true;1097 }1098 CvLandmass* pAdjacentBodyOfWater = GC.getMap().getLandmass(pAdjacentPlot->getLandmass());1099 if(pAdjacentBodyOfWater && pAdjacentBodyOfWater->getNumTiles() >= iMinWaterSize)1100 {1101 return true;1102 }1103 }1104 }1105 }11061107 return false;1108}
Calls
Called by
- CvAIOperationNavalBombardment::FindBestTarget()
- CvAIOperationNavalSuperiority::FindBestTarget()
- CvArea::countCoastalLand() const
- CvBarbarians::DoCamps()
- CvCity::isCoastal(int) const
- CityStrategyAIHelpers::IsTestCityStrategy_CoastCity(CvCity *)
- EconomicAIHelpers::IsTestStrategy_IslandStart(EconomicAIStrategyTypes, CvPlayer *)
- CvGame::getImprovementUpgradeTimeMod(ImprovementTypes, const CvPlot *) const
- CvHomelandAI::FindHomelandTargets()
- CvMap::DoPlaceNaturalWonders()
- CvMilitaryAI::ScoreTarget(CvMilitaryTarget &, AIOperationTypes)
- CvMinorCivAI::DoSpawnUnit(PlayerTypes, bool, bool)
- CvPlot::calculateImprovementYieldChange(ImprovementTypes, YieldTypes, PlayerTypes, bool, RouteTypes) const
- CvPlot::calculateNatureYield(YieldTypes, TeamTypes, bool) const
- CvPlot::canHaveFeature(FeatureTypes) const
- CvPlot::canHaveImprovement(ImprovementTypes, TeamTypes, bool) const
- CvPlot::canTrain(UnitTypes, bool, bool) const
- CvCitySiteEvaluator::CanFound(CvPlot *, const CvPlayer *, bool) const
- CvCitySiteEvaluator::PlotFoundValue(CvPlot *, CvPlayer *, YieldTypes, bool)
- CvSiteEvaluatorForSettler::PlotFoundValue(CvPlot *, CvPlayer *, YieldTypes, bool)
- CvSiteEvaluatorForStart::PlotFoundValue(CvPlot *, CvPlayer *, YieldTypes, bool)
- CvStartPositioner::AddCivToRegion(int, CvStartRegion, bool)
- CvUnit::PlotValid(CvPlot *, byte) const
- CvUnit::canEmbark(const CvPlot *) const
- CvUnit::canEnterTerrain(const CvPlot &, byte) const
- CvUnit::jumpToNearestValidPlot()
- CvLuaPlot::lIsCoastalLand(lua_State *)