CvCity::getProductionUnitAI() const
- Defined in
- CvCity.cpp, line 4104
- Class
- CvCity
- Hook name
CivHooks::CvCity_getProductionUnitAI
Hooks
static bool BeforeCvCity_getProductionUnitAI(const CvCity* self, UnitAITypes& result);static void AfterCvCity_getProductionUnitAI(const CvCity* self, UnitAITypes& result);static UnitAITypes ReplaceCvCity_getProductionUnitAI(UnitAITypes (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_getProductionUnitAI>(host, &BeforeCvCity_getProductionUnitAI);CivRegisterAfter<CivHooks::CvCity_getProductionUnitAI>(host, &AfterCvCity_getProductionUnitAI);CivRegisterReplace<CivHooks::CvCity_getProductionUnitAI>(host, &ReplaceCvCity_getProductionUnitAI);
Code
4104UnitAITypes CvCity::getProductionUnitAI() const4105{4106 VALIDATE_OBJECT4107 const OrderData* pOrderNode = headOrderQueueNode();41084109 if(pOrderNode != NULL)4110 {4111 switch(pOrderNode->eOrderType)4112 {4113 case ORDER_TRAIN:4114 return ((UnitAITypes)(pOrderNode->iData2));4115 break;41164117 case ORDER_CONSTRUCT:4118 case ORDER_CREATE:4119 case ORDER_PREPARE:4120 case ORDER_MAINTAIN:4121 break;41224123 default:4124 CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option");4125 break;4126 }4127 }41284129 return NO_UNITAI;4130}