getUnit(const IDInfo &)
- Defined in
- CvGameCoreUtils.cpp, line 185
- Hook name
CivHooks::getUnit
Hooks
static bool BeforegetUnit(const IDInfo& unit, CvUnit*& result);static void AftergetUnit(const IDInfo& unit, CvUnit*& result);static CvUnit* ReplacegetUnit(CvUnit* (*original)(const IDInfo&), const IDInfo& unit);CivRegisterBefore<CivHooks::getUnit>(host, &BeforegetUnit);CivRegisterAfter<CivHooks::getUnit>(host, &AftergetUnit);CivRegisterReplace<CivHooks::getUnit>(host, &ReplacegetUnit);
Code
185CvUnit* getUnit(const IDInfo& unit)186{187 if((unit.eOwner >= 0) && unit.eOwner < MAX_PLAYERS)188 {189 return (GET_PLAYER((PlayerTypes)unit.eOwner).getUnit(unit.iID));190 }191192 return NULL;193}
Calls
Called by
58 functions in 11 files
- CvAdvisorCounsel::BuildCounselList(PlayerTypes)
- CvAIOperationNukeAttack::FindBestTarget()
- CvCity::CanPlaceUnitHere(UnitTypes)
- CvCity::getCombatUnit()
- CvCity::getCombatUnit() const
- CvCity::kill(bool)
- CvGame::cyclePlotUnits(CvPlot *, bool, bool, int)
- CvGame::getPlotUnit(CvPlot *, int)
- CvGame::getPlotUnits(CvPlot *, std::vector<CvUnit *> &)
- CvGame::selectGroup(CvUnit *, bool, bool, bool)
- CvGame::updateMoves()
- CvHomelandAI::MoveCivilianToSafety(CvUnit *, bool, bool)
- CvMinorCivAI::CalculateBullyMetric(PlayerTypes, bool, CvString *)
- CvMinorCivAI::DoIntrusion()
- CvPlayer::DoCivilianReturnLogic(bool, PlayerTypes, int)
- CvPlayer::DoDistanceGift(PlayerTypes, CvUnit *)
- CvPlayer::acquireCity(CvCity *, bool, bool, bool)
- CvPlayer::canSpyBribeUnit(PlayerTypes, CvUnit &) const
- CvPlayer::disband(CvCity *)
- CvPlayer::doAdvancedStartAction(AdvancedStartActionTypes, int, int, int, bool)
- CvPlayer::getAdvancedStartUnitCost(UnitTypes, bool, CvPlot *)
- CvPlot::getLayerUnit(int, int) const
- CvPlot::updateVisibility()
- CvTacticalAI::ExecuteMovesToSafestPlot()
- CvUnit::CanSwapWithUnitHere(CvPlot &) const
- CvUnit::GetGreatGeneralStackMovement() const
- CvUnit::GetMissionAIUnit()
- CvUnit::GetNumEnemyUnitsAdjacent(const CvUnit *) const
- CvUnit::GetNumSpecificEnemyUnitsAdjacent(const CvUnit *, const CvUnit *) const
- CvUnit::GetReverseGreatGeneralModifier() const
- CvUnit::GetScrapGold() const
- CvUnit::IsFriendlyUnitAdjacent(bool) const
- CvUnit::IsNearGreatGeneral(int &) const
- CvUnit::IsNearSapper(const CvCity *) const
- CvUnit::IsStackedGreatGeneral() const
- CvUnit::SetAutomateType(AutomateTypes)
- CvUnit::canBuild(const CvPlot *, BuildTypes, bool, bool) const
- CvUnit::canCargoAllMove() const
- CvUnit::canGiveExperience(const CvPlot *) const
- CvUnit::canLead(const CvPlot *, int) const
- CvUnit::canLoad(const CvPlot &) const
- CvUnit::canMoveInto(const CvPlot &, byte) const
- CvUnit::canRangeStrikeAt(int, int, bool, bool) const
- CvUnit::canRebaseAt(const CvPlot *, int, int) const
- CvUnit::convert(CvUnit *, bool)
- CvUnit::getCombatUnit()
- CvUnit::getCombatUnit() const
- CvUnit::getTransportUnit()
- CvUnit::getTransportUnit() const
- CvUnit::getUnitAICargo(UnitAITypes) const
- CvUnit::gift(bool)
- CvUnit::giveExperience()
- CvUnit::healRate(const CvPlot *) const
- CvUnit::kill(bool, PlayerTypes)
- CvUnit::load()
- CvUnit::setXY(int, int, bool, bool, bool, bool, bool)
- CvUnit::unloadAll()
- CvUnitCombat::GenerateNuclearExplosionDamage(CvPlot *, int, CvUnit *, CvCombatMemberEntry *, int *, int)