Bazaar developer reference

CvMilitaryAI::GetThreatWeight(ThreatTypes)

Defined in
CvMilitaryAI.cpp, line 1594
Class
CvMilitaryAI
Hook name
CivHooks::CvMilitaryAI_GetThreatWeight

Hooks

static bool BeforeCvMilitaryAI_GetThreatWeight(CvMilitaryAI* self, ThreatTypes eThreat, int& result);static void AfterCvMilitaryAI_GetThreatWeight(CvMilitaryAI* self, ThreatTypes eThreat, int& result);static int ReplaceCvMilitaryAI_GetThreatWeight(int (*original)(CvMilitaryAI*, ThreatTypes), CvMilitaryAI* self, ThreatTypes eThreat);CivRegisterBefore<CivHooks::CvMilitaryAI_GetThreatWeight>(host, &BeforeCvMilitaryAI_GetThreatWeight);CivRegisterAfter<CivHooks::CvMilitaryAI_GetThreatWeight>(host, &AfterCvMilitaryAI_GetThreatWeight);CivRegisterReplace<CivHooks::CvMilitaryAI_GetThreatWeight>(host, &ReplaceCvMilitaryAI_GetThreatWeight);

Code

1593/// What is the numerical value of this threat level?1594int CvMilitaryAI::GetThreatWeight(ThreatTypes eThreat)1595{1596	int iRtnValue = 0;15971598	switch(eThreat)1599	{1600	case THREAT_MINOR:1601		iRtnValue = GC.getAI_MILITARY_THREAT_WEIGHT_MINOR();1602		break;1603	case THREAT_MAJOR:1604		iRtnValue = GC.getAI_MILITARY_THREAT_WEIGHT_MAJOR();1605		break;1606	case THREAT_SEVERE:1607		iRtnValue = GC.getAI_MILITARY_THREAT_WEIGHT_SEVERE();1608		break;1609	case THREAT_CRITICAL:1610		iRtnValue = GC.getAI_MILITARY_THREAT_WEIGHT_CRITICAL();1611		break;1612	}16131614	return iRtnValue;1615}

Calls

Called by