コード例 #1
0
ファイル: AILayer_Altar.cs プロジェクト: LeaderEnemyBoss/ELCP
    private static float UtilityFunc_EmpireLuxury(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        DepartmentOfScience     agency  = empire.GetAgency <DepartmentOfScience>();
        DepartmentOfTheInterior agency2 = empire.GetAgency <DepartmentOfTheInterior>();
        float num;
        float num2;

        AILayer_Altar.GetResourceUnitMarketPrice(empire, out num, out num2);
        float b = 0f;

        if (agency.GetTechnologyState(TechnologyDefinition.Names.MarketplaceResources) == DepartmentOfScience.ConstructibleElement.State.Researched)
        {
            float propertyValue = empire.GetPropertyValue(SimulationProperties.NetEmpireMoney);
            b = num2 / Mathf.Max(propertyValue, 1f);
        }
        float technologyUnlockedCount = agency.GetTechnologyUnlockedCount();
        float a    = (float)agency2.Cities.Count;
        float a2   = technologyUnlockedCount / (15f * Mathf.Max(a, 1f));
        float num3 = Mathf.Max(a2, b);

        return(aiParameterValue * num3);
    }
コード例 #2
0
ファイル: AILayer_Altar.cs プロジェクト: LeaderEnemyBoss/ELCP
    private static float UtilityFunc_EmpirePoint(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        float num     = Mathf.Max(1f, empire.GetPropertyValue(SimulationProperties.NetEmpirePoint));
        float utility = aiParameterValue / num;

        return(AILayer_Altar.Normalize(debugContext, 0.5f, 4f, utility));
    }
コード例 #3
0
ファイル: AILayer_Altar.cs プロジェクト: LeaderEnemyBoss/ELCP
    private static float UtilityFunc_EmpireResearch(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        if (empire.SimulationObject.Tags.Contains("AffinityReplicants"))
        {
            return(0f);
        }
        float num     = Mathf.Max(1f, empire.GetPropertyValue(SimulationProperties.NetEmpireResearch));
        float utility = aiParameterValue / num;

        return(AILayer_Altar.Normalize(debugContext, 0f, 1.7f, utility));
    }
コード例 #4
0
ファイル: AILayer_Altar.cs プロジェクト: LeaderEnemyBoss/ELCP
    private static float UtilityFunc_WorldNavy(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        IDownloadableContentService service = Services.GetService <IDownloadableContentService>();

        if (!service.IsShared(DownloadableContent16.ReadOnlyName))
        {
            return(0f);
        }
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        float num = AILayer_Altar.ComputeMyNavyImportance(empire);

        return(aiParameterValue * (num - 1f));
    }
コード例 #5
0
ファイル: AILayer_Altar.cs プロジェクト: LeaderEnemyBoss/ELCP
    private static float UtilityFunc_EmpireCityDefense(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        DepartmentOfTheInterior agency = empire.GetAgency <DepartmentOfTheInterior>();

        Diagnostics.Assert(agency != null);
        float num = Mathf.Max(1f, AILayer_Altar.GetCityPropertySumValue(empire, SimulationProperties.CityDefensePoint)) / (float)agency.Cities.Count;

        if (float.IsNaN(num))
        {
            return(0f);
        }
        float utility = aiParameterValue / num;

        return(AILayer_Altar.Normalize(debugContext, 0f, 3f, utility));
    }