Esempio n. 1
0
/// Based on game options (religion off, science off, etc.), would this branch do us any good?
bool CvPolicyAI::IsBranchEffectiveInGame(PolicyBranchTypes eBranch)
{
    CvPolicyBranchEntry* pBranchInfo = GC.getPolicyBranchInfo(eBranch);
    CvAssertMsg(pBranchInfo, "Branch info not found! Please send Anton your save file and version.");
    if (!pBranchInfo) return false;

    if (pBranchInfo->IsDelayWhenNoReligion())
        if (GC.getGame().isOption(GAMEOPTION_NO_RELIGION))
            return false;

    if (pBranchInfo->IsDelayWhenNoCulture())
        if (GC.getGame().isOption(GAMEOPTION_NO_POLICIES))
            return false;

    if (pBranchInfo->IsDelayWhenNoScience())
        if (GC.getGame().isOption(GAMEOPTION_NO_SCIENCE))
            return false;

    if (pBranchInfo->IsDelayWhenNoCityStates())
        if (GC.getGame().GetNumMinorCivsEver() <= 0)
            return false;

    return true;
}