CvCity::getProductionUnit() const
- Defined in
- CvCity.cpp, line 4074
- Class
- CvCity
- Hook name
CivHooks::CvCity_getProductionUnit
Hooks
static bool BeforeCvCity_getProductionUnit(const CvCity* self, UnitTypes& result);static void AfterCvCity_getProductionUnit(const CvCity* self, UnitTypes& result);static UnitTypes ReplaceCvCity_getProductionUnit(UnitTypes (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_getProductionUnit>(host, &BeforeCvCity_getProductionUnit);CivRegisterAfter<CivHooks::CvCity_getProductionUnit>(host, &AfterCvCity_getProductionUnit);CivRegisterReplace<CivHooks::CvCity_getProductionUnit>(host, &ReplaceCvCity_getProductionUnit);
Code
4074UnitTypes CvCity::getProductionUnit() const4075{4076 VALIDATE_OBJECT4077 const OrderData* pOrderNode = headOrderQueueNode();40784079 if(pOrderNode != NULL)4080 {4081 switch(pOrderNode->eOrderType)4082 {4083 case ORDER_TRAIN:4084 return ((UnitTypes)(pOrderNode->iData1));4085 break;40864087 case ORDER_CONSTRUCT:4088 case ORDER_CREATE:4089 case ORDER_PREPARE:4090 case ORDER_MAINTAIN:4091 break;40924093 default:4094 CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option");4095 break;4096 }4097 }40984099 return NO_UNIT;4100}
Calls
Called by
- CvCity::changeProduction(int)
- CvCity::changeProductionTimes100(int)
- CvCity::doDecay()
- CvCity::setProduction(int)
- CvCity::setProductionTimes100(int)
- EconomicAIHelpers::IsTestStrategy_ReallyNeedReconSea(CvPlayer *)
- CvPlayer::GetNumUnitsWithUnitAI(UnitAITypes, bool, bool)
- CvTradeAI::PrioritizeTradeRoutes(TradeConnectionList &)
- CvUnit::canHurry(const CvPlot *, bool) const
- CvLuaCity::lGetProductionUnit(lua_State *)