void CvPlayer::doAnnexation(int value1)
{
CvUnit* pGiftUnit;
PlayerTypes eNewPlayer = ((PlayerTypes)value1);
if (eNewPlayer == NO_PLAYER)
{
return;
}
int iLoop;
for (CvUnit* pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))
{
CvPlot* pPlot = pLoopUnit->plot();
pGiftUnit = GET_PLAYER(eNewPlayer).initUnit(pLoopUnit->getUnitType(), pLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
pGiftUnit->convert(pLoopUnit);
}
for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
{
int iCulture = pLoopCity->getCultureTimes100(getID());
CvPlot* pPlot = pLoopCity->plot();
GET_PLAYER(eNewPlayer).acquireCity(pLoopCity, false, true, false);
if (NULL != pPlot)
{
CvCity* pCity = pPlot->getPlotCity();
if (NULL != pCity)
{
pCity->setCultureTimes100(getID(), 0, false, false);
pCity->setCultureTimes100(eNewPlayer, iCulture, true, false);
}
}
}
return;
}