Bazaar developer reference

CvHomelandAI::ExecuteScientistMoves()

Defined in
CvHomelandAI.cpp, line 3670
Class
CvHomelandAI
Hook name
CivHooks::CvHomelandAI_ExecuteScientistMoves

Hooks

static bool BeforeCvHomelandAI_ExecuteScientistMoves(CvHomelandAI* self);static void AfterCvHomelandAI_ExecuteScientistMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_ExecuteScientistMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_ExecuteScientistMoves>(host, &BeforeCvHomelandAI_ExecuteScientistMoves);CivRegisterAfter<CivHooks::CvHomelandAI_ExecuteScientistMoves>(host, &AfterCvHomelandAI_ExecuteScientistMoves);CivRegisterReplace<CivHooks::CvHomelandAI_ExecuteScientistMoves>(host, &ReplaceCvHomelandAI_ExecuteScientistMoves);

Code

3669/// Expends a scientist to gain a free tech3670void CvHomelandAI::ExecuteScientistMoves()3671{3672	FStaticVector< CvHomelandUnit, 64, true, c_eCiv5GameplayDLL >::iterator it;3673	for(it = m_CurrentMoveUnits.begin(); it != m_CurrentMoveUnits.end(); ++it)3674	{3675		UnitHandle pUnit = m_pPlayer->getUnit(it->GetID());3676		if(!pUnit)3677		{3678			continue;3679		}36803681		GreatPeopleDirectiveTypes eDirective = pUnit->GetGreatPeopleDirective();3682		switch(eDirective)3683		{3684		case GREAT_PEOPLE_DIRECTIVE_GOLDEN_AGE:3685			ExecuteGoldenAgeMove(pUnit.pointer());3686			break;3687		case GREAT_PEOPLE_DIRECTIVE_USE_POWER:3688			pUnit->PushMission(CvTypes::getMISSION_DISCOVER());3689			UnitProcessed(pUnit->GetID());3690			if(GC.getLogging() && GC.getAILogging())3691			{3692				CvString strLogString;3693				strLogString.Format("Great scientist discovered free tech at, X: %d, Y: %d", pUnit->getX(), pUnit->getY());3694				LogHomelandMessage(strLogString);3695			}3696			break;3697		case GREAT_PEOPLE_DIRECTIVE_CONSTRUCT_IMPROVEMENT:3698			ExecuteWorkerMove(pUnit.pointer());3699			break;3700		case NO_GREAT_PEOPLE_DIRECTIVE_TYPE:3701			MoveCivilianToSafety(pUnit.pointer());3702			break;3703		}3704	}3705}

Calls

Called by