本文整理汇总了C++中CvCity::GetCityCitizens方法的典型用法代码示例。如果您正苦于以下问题:C++ CvCity::GetCityCitizens方法的具体用法?C++ CvCity::GetCityCitizens怎么用?C++ CvCity::GetCityCitizens使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvCity
的用法示例。
在下文中一共展示了CvCity::GetCityCitizens方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResponseUpdateCityCitizens
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseUpdateCityCitizens(PlayerTypes ePlayer, int iCityID)
{
CvCity* pCity = GET_PLAYER(ePlayer).getCity(iCityID);
if(NULL != pCity && pCity->GetCityCitizens())
{
CvCityCitizens* pkCitizens = pCity->GetCityCitizens();
if(pkCitizens != NULL)
{
pkCitizens->DoVerifyWorkingPlots();
pkCitizens->DoReallocateCitizens();
}
}
}
示例2: ResponseFaithGreatPersonChoice
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseFaithGreatPersonChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit)
{
CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);
CvCity* pCity = kPlayer.GetGreatPersonSpawnCity(eGreatPersonUnit);
if(pCity)
{
#if defined(MOD_GLOBAL_TRULY_FREE_GP)
pCity->GetCityCitizens()->DoSpawnGreatPerson(eGreatPersonUnit, true, true, false);
#else
pCity->GetCityCitizens()->DoSpawnGreatPerson(eGreatPersonUnit, true, true);
#endif
}
kPlayer.ChangeNumFaithGreatPeople(-1);
}
示例3: ResponseMayaBonusChoice
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseMayaBonusChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit)
{
CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);
CvCity* pCity = kPlayer.GetGreatPersonSpawnCity(eGreatPersonUnit);
if(pCity)
{
#if defined(MOD_GLOBAL_TRULY_FREE_GP)
pCity->GetCityCitizens()->DoSpawnGreatPerson(eGreatPersonUnit, true, false, MOD_GLOBAL_TRULY_FREE_GP);
#else
pCity->GetCityCitizens()->DoSpawnGreatPerson(eGreatPersonUnit, true, false);
#endif
}
kPlayer.ChangeNumMayaBoosts(-1);
kPlayer.GetPlayerTraits()->SetUnitBaktun(eGreatPersonUnit);
}
示例4: ResponseSetCityAIFocus
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseSetCityAIFocus(PlayerTypes ePlayer, int iCityID, CityAIFocusTypes eFocus)
{
CvCity* pCity = GET_PLAYER(ePlayer).getCity(iCityID);
if(pCity != NULL)
{
CvCityCitizens* pkCitizens = pCity->GetCityCitizens();
if(pkCitizens != NULL)
{
pkCitizens->SetFocusType(eFocus);
}
}
}
示例5: ResponseUpdateCityCitizens
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseUpdateCityCitizens(PlayerTypes ePlayer, int iCityID)
{
//there was a crash when this was called while the map is uninitialized
if (GC.getMap().numPlots()==0)
return;
CvCity* pCity = GET_PLAYER(ePlayer).getCity(iCityID);
if(NULL != pCity && pCity->GetCityCitizens())
{
CvCityCitizens* pkCitizens = pCity->GetCityCitizens();
if(pkCitizens != NULL)
{
pkCitizens->DoVerifyWorkingPlots();
pkCitizens->DoReallocateCitizens();
}
}
}
示例6: ResponseFaithGreatPersonChoice
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseFaithGreatPersonChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit)
{
CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);
CvCity* pCity = kPlayer.GetGreatPersonSpawnCity(eGreatPersonUnit);
if(pCity)
{
pCity->GetCityCitizens()->DoSpawnGreatPerson(eGreatPersonUnit, true, true);
}
kPlayer.ChangeNumFaithGreatPeople(-1);
}
示例7: ResponseSetCityAvoidGrowth
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseSetCityAvoidGrowth(PlayerTypes ePlayer, int iCityID, bool bAvoidGrowth)
{
CvCity* pCity = GET_PLAYER(ePlayer).getCity(iCityID);
if(pCity != NULL)
{
CvCityCitizens* pkCitizens = pCity->GetCityCitizens();
if(pkCitizens != NULL)
{
pkCitizens->SetForcedAvoidGrowth(bAvoidGrowth);
}
}
}
示例8: AI_chooseFreeGreatPerson
void CvPlayerAI::AI_chooseFreeGreatPerson()
{
while(GetNumFreeGreatPeople() > 0)
{
UnitTypes eDesiredGreatPerson = NO_UNIT;
// Highly wonder competitive and still early in game?
if(GetDiplomacyAI()->GetWonderCompetitiveness() >= 8 && GC.getGame().getGameTurn() <= (GC.getGame().getEstimateEndTurn() / 2))
{
eDesiredGreatPerson = (UnitTypes)GC.getInfoTypeForString("UNIT_ENGINEER");
}
else
{
// Pick the person based on our victory method
AIGrandStrategyTypes eVictoryStrategy = GetGrandStrategyAI()->GetActiveGrandStrategy();
if(eVictoryStrategy == (AIGrandStrategyTypes) GC.getInfoTypeForString("AIGRANDSTRATEGY_CONQUEST"))
{
eDesiredGreatPerson = (UnitTypes)GC.getInfoTypeForString("UNIT_GREAT_GENERAL");
}
else if(eVictoryStrategy == (AIGrandStrategyTypes) GC.getInfoTypeForString("AIGRANDSTRATEGY_CULTURE"))
{
eDesiredGreatPerson = (UnitTypes)GC.getInfoTypeForString("UNIT_ARTIST");
}
else if(eVictoryStrategy == (AIGrandStrategyTypes) GC.getInfoTypeForString("AIGRANDSTRATEGY_UNITED_NATIONS"))
{
eDesiredGreatPerson = (UnitTypes)GC.getInfoTypeForString("UNIT_MERCHANT");
}
else if(eVictoryStrategy == (AIGrandStrategyTypes) GC.getInfoTypeForString("AIGRANDSTRATEGY_SPACESHIP"))
{
eDesiredGreatPerson = (UnitTypes)GC.getInfoTypeForString("UNIT_SCIENTIST");
}
}
if(eDesiredGreatPerson != NO_UNIT)
{
CvCity* pCapital = getCapitalCity();
if(pCapital)
{
pCapital->GetCityCitizens()->DoSpawnGreatPerson(eDesiredGreatPerson, true, false);
}
ChangeNumFreeGreatPeople(-1);
}
else
{
break;
}
}
}