CvTeam::isProjectMaxedOut(ProjectTypes, int) const
- Defined in
- CvTeam.cpp, line 4592
- Class
- CvTeam
- Hook name
CivHooks::CvTeam_isProjectMaxedOut
Hooks
static bool BeforeCvTeam_isProjectMaxedOut(const CvTeam* self, ProjectTypes eIndex, int iExtra, bool& result);static void AfterCvTeam_isProjectMaxedOut(const CvTeam* self, ProjectTypes eIndex, int iExtra, bool& result);static bool ReplaceCvTeam_isProjectMaxedOut(bool (*original)(const CvTeam*, ProjectTypes, int), const CvTeam* self, ProjectTypes eIndex, int iExtra);CivRegisterBefore<CivHooks::CvTeam_isProjectMaxedOut>(host, &BeforeCvTeam_isProjectMaxedOut);CivRegisterAfter<CivHooks::CvTeam_isProjectMaxedOut>(host, &AfterCvTeam_isProjectMaxedOut);CivRegisterReplace<CivHooks::CvTeam_isProjectMaxedOut>(host, &ReplaceCvTeam_isProjectMaxedOut);
Code
4592bool CvTeam::isProjectMaxedOut(ProjectTypes eIndex, int iExtra) const4593{4594 CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");4595 CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");45964597 if(!isTeamProject(eIndex))4598 {4599 return false;4600 }46014602 CvAssertMsg(getProjectCount(eIndex) <= GC.getProjectInfo(eIndex)->GetMaxTeamInstances(), "Current Project count is expected to not exceed the maximum number of instances for this project");46034604 return ((getProjectCount(eIndex) + iExtra) >= GC.getProjectInfo(eIndex)->GetMaxTeamInstances());4605}