CvTeam::shareCounters(TeamTypes)
- Defined in
- CvTeam.cpp, line 671
- Class
- CvTeam
- Hook name
CivHooks::CvTeam_shareCounters
Hooks
static bool BeforeCvTeam_shareCounters(CvTeam* self, TeamTypes eTeam);static void AfterCvTeam_shareCounters(CvTeam* self, TeamTypes eTeam);static void ReplaceCvTeam_shareCounters(void (*original)(CvTeam*, TeamTypes), CvTeam* self, TeamTypes eTeam);CivRegisterBefore<CivHooks::CvTeam_shareCounters>(host, &BeforeCvTeam_shareCounters);CivRegisterAfter<CivHooks::CvTeam_shareCounters>(host, &AfterCvTeam_shareCounters);CivRegisterReplace<CivHooks::CvTeam_shareCounters>(host, &ReplaceCvTeam_shareCounters);
Code
671void CvTeam::shareCounters(TeamTypes eTeam)672{673 int iI;674675 for(iI = 0; iI < GC.getNumProjectInfos(); iI++)676 {677 int iExtraProjects = GET_TEAM(eTeam).getProjectCount((ProjectTypes)iI) - getProjectCount((ProjectTypes)iI);678 if(iExtraProjects > 0)679 {680 changeProjectCount((ProjectTypes)iI, iExtraProjects);681 GC.getGame().incrementProjectCreatedCount((ProjectTypes)iI, -iExtraProjects);682 }683684 changeProjectMaking(((ProjectTypes)iI), GET_TEAM(eTeam).getProjectMaking((ProjectTypes)iI));685 }686687 for(iI = 0; iI < GC.getNumUnitClassInfos(); iI++)688 {689 CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo((UnitClassTypes)iI);690 if(!pkUnitClassInfo)691 {692 continue;693 }694695 changeUnitClassCount(((UnitClassTypes)iI), GET_TEAM(eTeam).getUnitClassCount((UnitClassTypes)iI));696 }697698 for(iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)699 {700 CvBuildingClassInfo* pkBuildingClassInfo = GC.getBuildingClassInfo((BuildingClassTypes)iI);701 if(!pkBuildingClassInfo)702 {703 continue;704 }705706 changeBuildingClassCount(((BuildingClassTypes)iI), GET_TEAM(eTeam).getBuildingClassCount((BuildingClassTypes)iI));707 }708709 for(iI = 0; iI < GC.getNumTechInfos(); iI++)710 {711 if(GET_TEAM(eTeam).GetTeamTechs()->GetResearchProgress((TechTypes)iI) > GetTeamTechs()->GetResearchProgress((TechTypes)iI))712 {713 GetTeamTechs()->SetResearchProgress(((TechTypes)iI), GET_TEAM(eTeam).GetTeamTechs()->GetResearchProgress((TechTypes)iI), getLeaderID());714 }715716 if(GET_TEAM(eTeam).GetTeamTechs()->IsNoTradeTech((TechTypes)iI))717 {718 GetTeamTechs()->SetNoTradeTech((TechTypes)iI, true);719 }720 }721}
Calls
- CvGame::incrementProjectCreatedCount(ProjectTypes, int)
- CvGlobals::getBuildingClassInfo(BuildingClassTypes)
- CvGlobals::getGame()
- CvGlobals::getNumBuildingClassInfos()
- CvGlobals::getNumProjectInfos()
- CvGlobals::getNumTechInfos()
- CvGlobals::getNumUnitClassInfos()
- CvGlobals::getUnitClassInfo(UnitClassTypes)
- CvTeam::changeBuildingClassCount(BuildingClassTypes, int)
- CvTeam::changeProjectCount(ProjectTypes, int)
- CvTeam::changeProjectMaking(ProjectTypes, int)
- CvTeam::changeUnitClassCount(UnitClassTypes, int)
- CvTeam::getBuildingClassCount(BuildingClassTypes) const
- CvTeam::getLeaderID() const
- CvTeam::getProjectCount(ProjectTypes) const
- CvTeam::getProjectMaking(ProjectTypes) const
- CvTeam::getTeam(TeamTypes)
- CvTeam::GetTeamTechs() const
- CvTeam::getUnitClassCount(UnitClassTypes) const
- CvTeamTechs::GetResearchProgress(TechTypes) const
- CvTeamTechs::IsNoTradeTech(TechTypes) const
- CvTeamTechs::SetNoTradeTech(TechTypes, bool)
- CvTeamTechs::SetResearchProgress(TechTypes, int, PlayerTypes)