當前位置: 首頁>>代碼示例>>C#>>正文


C# App.GetStratModifier方法代碼示例

本文整理匯總了C#中System.App.GetStratModifier方法的典型用法代碼示例。如果您正苦於以下問題:C# App.GetStratModifier方法的具體用法?C# App.GetStratModifier怎麽用?C# App.GetStratModifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.App的用法示例。


在下文中一共展示了App.GetStratModifier方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PreBuildLists

        //private static readonly string UIStationInvoicesList = "stationinvoicelist";
        private static Budget PreBuildLists(App app, PlayerInfo playerInfo, string panelName)
        {
            bool stratModifier = app.GetStratModifier<bool>(Kerberos.Sots.Data.StratModifiers.EnableTrade, app.LocalPlayer.ID);

            Budget budget = Budget.GenerateBudget(app.Game, playerInfo, null, BudgetProjection.Pessimistic);

            double num3 = (double)((1f - playerInfo.RateGovernmentResearch) * 100f);
            double num4 = (double)(playerInfo.RateGovernmentSecurity * 100f);
            double num5 = (double)(playerInfo.RateSecurityOperations * 100f);
            double num6 = (double)(playerInfo.RateSecurityIntelligence * 100f);
            double num7 = (double)(playerInfo.RateSecurityCounterIntelligence * 100f);
            double num8 = (double)(playerInfo.RateGovernmentStimulus * 100f);
            double num9 = (double)(playerInfo.RateStimulusMining * 100f);
            double num10 = (double)(playerInfo.RateStimulusColonization * 100f);
            double num11 = (double)(playerInfo.RateStimulusTrade * 100f);
            double num12 = (double)(playerInfo.RateGovernmentSavings * 100f);
            float arg_29B_0 = playerInfo.RateGovernmentResearch;
            double num13 = (double)(playerInfo.RateResearchCurrentProject * 100f);
            double num14 = (double)(playerInfo.RateResearchSpecialProject * 100f);
            double num15 = (double)(playerInfo.RateResearchSalvageResearch * 100f);
            string text = budget.TotalRevenue.ToString("N0");
            string text2 = budget.ProjectedGovernmentSpending.ToString("N0");
            string text3 = budget.ResearchSpending.ProjectedTotal.ToString("N0");
            string text4 = budget.SecuritySpending.ProjectedTotal.ToString("N0");
            double num16 = budget.SecuritySpending.ProjectedOperations;
            string text5 = num16.ToString("N0");
            num16 = budget.SecuritySpending.ProjectedIntelligence;
            string text6 = num16.ToString("N0");
            num16 = budget.SecuritySpending.ProjectedCounterIntelligence;
            string text7 = num16.ToString("N0");
            string text8 = budget.StimulusSpending.ProjectedTotal.ToString("N0");
            num16 = budget.StimulusSpending.ProjectedMining;
            string text9 = num16.ToString("N0");
            num16 = budget.StimulusSpending.ProjectedColonization;
            string text10 = num16.ToString("N0");
            num16 = budget.StimulusSpending.ProjectedTrade;
            string text11 = num16.ToString("N0");
            string text12 = budget.NetSavingsIncome.ToString("N0");
            string text13 = budget.CurrentSavings.ToString("N0");
            string text14 = budget.SavingsInterest.ToString("N0");
            string text15 = budget.ProjectedSavings.ToString("N0");
            num16 = budget.ResearchSpending.ProjectedCurrentProject;
            string text16 = num16.ToString("N0");
            num16 = budget.ResearchSpending.ProjectedSpecialProject;
            string text17 = num16.ToString("N0");
            num16 = budget.ResearchSpending.ProjectedSalvageResearch;
            string text18 = num16.ToString("N0");
            string text19 = (budget.ColonySupportExpenses + budget.CurrentShipUpkeepExpenses + budget.CurrentStationUpkeepExpenses + budget.CorruptionExpenses + budget.DebtInterest).ToString("N0");
            string text20 = (budget.TotalExpenses + budget.PendingBuildStationsCost + budget.PendingStationsModulesCost + budget.PendingBuildShipsCost).ToString("N0");
            string text21 = budget.ColonySupportExpenses.ToString("N0");
            string text22 = budget.CurrentShipUpkeepExpenses.ToString("N0");
            string text23 = budget.CurrentStationUpkeepExpenses.ToString("N0");
            string text24 = budget.CorruptionExpenses.ToString("N0");
            string text25 = budget.DebtInterest.ToString("N0");
            string text26 = budget.TaxRevenue.ToString("N0");
            string text27 = text2;
            string text28 = text20;
            string text29 = text3;
            string text30 = text13;
            string text31 = text15;

             string text40 = budget.PendingBuildShipsCost.ToString("N0");
            string text41 = (budget.PendingBuildStationsCost + budget.PendingStationsModulesCost).ToString("N0");
            string text42 = (budget.TotalExpenses + budget.TotalBuildShipCosts + budget.TotalBuildStationsCost + budget.TotalStationsModulesCost).ToString("N0");
            string text43 = "Turn " + app.GameDatabase.GetTurnCount().ToString("N0");
            app.UI.SetEnabled(EmpireSummaryStateBehaviour.UITradeSlider, stratModifier);
            app.UI.SetEnabled(EmpireSummaryStateBehaviour.UIMiningSlider, app.GameDatabase.PlayerHasTech(app.LocalPlayer.ID, "IND_Mega-Strip_Mining"));
            if (app.LocalPlayer.Faction.Name == "loa" && app.GameDatabase.GetPlayerInfo(app.LocalPlayer.ID).Savings < 0.0)
            {
                app.UI.SetEnabled(EmpireSummaryStateBehaviour.UIGovernmentResearchSlider, false);
            }
            else
            {
                app.UI.SetEnabled(EmpireSummaryStateBehaviour.UIGovernmentResearchSlider, true);
            }
            if (panelName != EmpireSummaryStateBehaviour.UIGovernmentResearchSlider)
            {
                app.UI.SetSliderValue(EmpireSummaryStateBehaviour.UIGovernmentResearchSlider, (int)num3);
            }
            if (panelName != EmpireSummaryStateBehaviour.UISecuritySlider)
            {
                app.UI.SetSliderValue(EmpireSummaryStateBehaviour.UISecuritySlider, (int)num4);
            }
            if (budget.ProjectedGovernmentSpending > 0.0)
            {
                app.UI.ClearSliderNotches(EmpireSummaryStateBehaviour.UISecuritySlider);
                app.UI.AddSliderNotch(EmpireSummaryStateBehaviour.UISecuritySlider, budget.RequiredSecurity);
                if (app.GameDatabase.GetSliderNotchSettingInfo(app.LocalPlayer.ID, UISlidertype.SecuritySlider) != null)
                {
                    app.UI.SetSliderValue(EmpireSummaryStateBehaviour.UISecuritySlider, budget.RequiredSecurity);
                    EmpireSummaryState.DistributeGovernmentSpending(app.Game, EmpireSummaryState.GovernmentSpendings.Security, (float)Math.Min((double)((float)budget.RequiredSecurity / 100f), 1.0), playerInfo);
                }
            }
            if (panelName != EmpireSummaryStateBehaviour.UIOperationsSlider)
            {
                app.UI.SetSliderValue(EmpireSummaryStateBehaviour.UIOperationsSlider, (int)num5);
            }
            if (panelName != EmpireSummaryStateBehaviour.UIIntelSlider)
            {
//.........這裏部分代碼省略.........
開發者ID:nugarin,項目名稱:sotsos,代碼行數:101,代碼來源:EmpireSummaryStateBehaviour.cs


注:本文中的System.App.GetStratModifier方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。