void CvPlayer::doTurn()
{
PROFILE_FUNC();
CvCity* pLoopCity;
int iLoop;
FAssertMsg(isAlive(), "isAlive is expected to be true");
FAssertMsg(!hasBusyUnit() || GC.getGameINLINE().isMPOption(MPOPTION_SIMULTANEOUS_TURNS), "End of turn with busy units in a sequential-turn game");
gDLL->getEventReporterIFace()->beginPlayerTurn( GC.getGameINLINE().getGameTurn(), getID());
GC.getGameINLINE().verifyDeals();
AI_doTurnPre();
if (getRevolutionTimer() > 0)
{
changeRevolutionTimer(-1);
}
if (getConversionTimer() > 0)
{
changeConversionTimer(-1);
}
setConscriptCount(0);
verifyGoldCommercePercent();
doGold();
doResearch();
for (pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
{
pLoopCity->doTurn();
}
if (getGoldenAgeTurns() > 0)
{
changeGoldenAgeTurns(-1);
}
if (getAnarchyTurns() > 0)
{
changeAnarchyTurns(-1);
}
verifyCivics();
updateTradeRoutes();
updateWarWearinessPercentAnger();
updateEconomyHistory(GC.getGameINLINE().getGameTurn(), calculateTotalYield(YIELD_COMMERCE) - calculateInflatedCosts());
updateIndustryHistory(GC.getGameINLINE().getGameTurn(), calculateTotalYield(YIELD_PRODUCTION));
updateAgricultureHistory(GC.getGameINLINE().getGameTurn(), calculateTotalYield(YIELD_FOOD));
updatePowerHistory(GC.getGameINLINE().getGameTurn(), getPower());
updateCultureHistory(GC.getGameINLINE().getGameTurn(), countTotalCulture());
expireMessages(); // turn log
gDLL->getInterfaceIFace()->setDirty(CityInfo_DIRTY_BIT, true);
AI_doTurnPost();
gDLL->getEventReporterIFace()->endPlayerTurn( GC.getGameINLINE().getGameTurn(), getID());
}