CvDiplomacyAI::GetTotalLandDisputeLevel()
- Defined in
- CvDiplomacyAI.cpp, line 7715
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetTotalLandDisputeLevel
Hooks
static bool BeforeCvDiplomacyAI_GetTotalLandDisputeLevel(CvDiplomacyAI* self, int& result);static void AfterCvDiplomacyAI_GetTotalLandDisputeLevel(CvDiplomacyAI* self, int& result);static int ReplaceCvDiplomacyAI_GetTotalLandDisputeLevel(int (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetTotalLandDisputeLevel>(host, &BeforeCvDiplomacyAI_GetTotalLandDisputeLevel);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetTotalLandDisputeLevel>(host, &AfterCvDiplomacyAI_GetTotalLandDisputeLevel);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetTotalLandDisputeLevel>(host, &ReplaceCvDiplomacyAI_GetTotalLandDisputeLevel);
Code
7714/// Returns an integer that increases as the number and severity of land disputes rises7715int CvDiplomacyAI::GetTotalLandDisputeLevel()7716{7717 int iRtnValue = 0; // slewis added, to fix a compile error. I'm guessing zero is correct.7718 PlayerTypes ePlayer;77197720 for(int iPlayerLoop = 0; iPlayerLoop < MAX_CIV_PLAYERS; iPlayerLoop++)7721 {7722 ePlayer = (PlayerTypes) iPlayerLoop;77237724 if(IsPlayerValid(ePlayer))7725 {7726 switch(GetLandDisputeLevel(ePlayer))7727 {7728 case DISPUTE_LEVEL_FIERCE:7729 iRtnValue += GC.getAI_DIPLO_LAND_DISPUTE_WEIGHT_FIERCE();7730 break;7731 case DISPUTE_LEVEL_STRONG:7732 iRtnValue += GC.getAI_DIPLO_LAND_DISPUTE_WEIGHT_STRONG();7733 break;7734 case DISPUTE_LEVEL_WEAK:7735 iRtnValue += GC.getAI_DIPLO_LAND_DISPUTE_WEIGHT_WEAK();7736 break;7737 }7738 }7739 }7740 return iRtnValue;7741}