Example #1
0
        public void RecalculateBuildRates()
        {
            VABRates.Clear();
            SPHRates.Clear();
            double rate  = 0.1;
            int    index = 0;

            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.VAB, index, this);
                if (rate >= 0)
                {
                    VABRates.Add(rate);
                }
                index++;
            }
            rate  = 0.1;
            index = 0;
            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.SPH, index, this);
                if (rate >= 0)
                {
                    SPHRates.Add(rate);
                }
                index++;
            }
        }
Example #2
0
File: KSC.cs Project: ntwest/KCT
        public void RecalculateBuildRates()
        {
            const string logBlockName = nameof(SpaceCenterConstruction) + "." + nameof(RecalculateBuildRates);

            using (EntryExitLogger.EntryExitLog(logBlockName, EntryExitLoggerOptions.All))
            {
                VABRates.Clear();
                SPHRates.Clear();
                double rate  = 0.1;
                int    index = 0;
                while (rate > 0)
                {
                    rate = KCT_MathParsing.ParseBuildRateFormula(BuildListVessel.ListType.VAB, index, this);
                    if (rate >= 0)
                    {
                        VABRates.Add(rate);
                    }
                    index++;
                }
                rate  = 0.1;
                index = 0;
                while (rate > 0)
                {
                    rate = KCT_MathParsing.ParseBuildRateFormula(BuildListVessel.ListType.SPH, index, this);
                    if (rate >= 0)
                    {
                        SPHRates.Add(rate);
                    }
                    index++;
                }

                Log.Trace("VAB Rates:");
                foreach (double v in VABRates)
                {
                    Log.Trace(v.ToString());
                }

                Log.Trace("SPH Rates:");
                foreach (double v in SPHRates)
                {
                    Log.Trace(v.ToString());
                }
            }
        }
Example #3
0
        public void RecalculateBuildRates()
        {
            VABRates.Clear();
            SPHRates.Clear();
            double rate  = 0.1;
            int    index = 0;

            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.VAB, index, this);
                if (rate >= 0)
                {
                    VABRates.Add(rate);
                }
                index++;
            }
            rate  = 0.1;
            index = 0;
            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.SPH, index, this);
                if (rate >= 0)
                {
                    SPHRates.Add(rate);
                }
                index++;
            }

            KCTDebug.Log("VAB Rates:");
            foreach (double v in VABRates)
            {
                KCTDebug.Log(v);
            }

            KCTDebug.Log("SPH Rates:");
            foreach (double v in SPHRates)
            {
                KCTDebug.Log(v);
            }
        }
Example #4
0
File: KSC.cs Project: ntwest/KCT
        public void RecalculateUpgradedBuildRates()
        {
            const string logBlockName = nameof(SpaceCenterConstruction) + "." + nameof(RecalculateUpgradedBuildRates);

            using (EntryExitLogger.EntryExitLog(logBlockName, EntryExitLoggerOptions.All))
            {
                UpVABRates.Clear();
                UpSPHRates.Clear();
                double rate  = 0.1;
                int    index = 0;
                while (rate > 0)
                {
                    rate = KCT_MathParsing.ParseBuildRateFormula(BuildListVessel.ListType.VAB, index, this, true);
                    if (rate >= 0 && (index == 0 || VABRates[index - 1] > 0))
                    {
                        UpVABRates.Add(rate);
                    }
                    else
                    {
                        break;
                    }
                    index++;
                }
                rate  = 0.1;
                index = 0;
                while (rate > 0)
                {
                    rate = KCT_MathParsing.ParseBuildRateFormula(BuildListVessel.ListType.SPH, index, this, true);
                    if (rate >= 0 && (index == 0 || SPHRates[index - 1] > 0))
                    {
                        UpSPHRates.Add(rate);
                    }
                    else
                    {
                        break;
                    }
                    index++;
                }
            }
        }
Example #5
0
        public void RecalculateUpgradedBuildRates()
        {
            UpVABRates.Clear();
            UpSPHRates.Clear();
            double rate  = 0.1;
            int    index = 0;

            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.VAB, index, this, true);
                if (rate >= 0 && (index == 0 || VABRates[index - 1] > 0))
                {
                    UpVABRates.Add(rate);
                }
                else
                {
                    break;
                }
                index++;
            }
            rate  = 0.1;
            index = 0;
            while (rate > 0)
            {
                rate = KCT_MathParsing.ParseBuildRateFormula(KCT_BuildListVessel.ListType.SPH, index, this, true);
                if (rate >= 0 && (index == 0 || SPHRates[index - 1] > 0))
                {
                    UpSPHRates.Add(rate);
                }
                else
                {
                    break;
                }
                index++;
            }
        }