Bazaar developer reference

CvActionInfo::getCommandType() const

Defined in
CvInfos.cpp, line 1102
Class
CvActionInfo
Hook name
CivHooks::CvActionInfo_getCommandType

Hooks

static bool BeforeCvActionInfo_getCommandType(const CvActionInfo* self, int& result);static void AfterCvActionInfo_getCommandType(const CvActionInfo* self, int& result);static int ReplaceCvActionInfo_getCommandType(int (*original)(const CvActionInfo*), const CvActionInfo* self);CivRegisterBefore<CivHooks::CvActionInfo_getCommandType>(host, &BeforeCvActionInfo_getCommandType);CivRegisterAfter<CivHooks::CvActionInfo_getCommandType>(host, &AfterCvActionInfo_getCommandType);CivRegisterReplace<CivHooks::CvActionInfo_getCommandType>(host, &ReplaceCvActionInfo_getCommandType);

Code

1102int CvActionInfo::getCommandType() const1103{1104	if(ACTIONSUBTYPE_COMMAND == m_eSubType)1105	{1106		return m_iOriginalIndex;1107	}1108	else if(ACTIONSUBTYPE_PROMOTION == m_eSubType)1109	{1110		CvPromotionEntry* pkPromotionInfo = GC.getPromotionInfo((PromotionTypes)m_iOriginalIndex);1111		if(pkPromotionInfo)1112		{1113			return pkPromotionInfo->GetCommandType();1114		}1115	}1116	else if(ACTIONSUBTYPE_AUTOMATE == m_eSubType)1117	{1118		CvAutomateInfo* pkAutomateInfo = GC.getAutomateInfo(m_iOriginalIndex);1119		if(pkAutomateInfo)1120		{1121			return pkAutomateInfo->getCommand();1122		}1123	}11241125	return NO_COMMAND;1126}

Calls

Called by