StretchyTanks.StretchyTanks.updateMaxRFactor C# (CSharp) Method

updateMaxRFactor() public method

public updateMaxRFactor ( ) : void
return void
        public virtual void updateMaxRFactor()
        {
            if (!superStretch) return;
            maxRFactor = 100f;
            if (HighLogic.CurrentGame == null || HighLogic.CurrentGame.Mode != Game.Modes.CAREER)
                return;

            foreach (ConfigNode tech in GameDatabase.Instance.GetConfigNodes("STRETCHYTANKMAXRAD"))
            {
                maxRFactor = 0.01f;
                for (int i = 0; i < tech.values.Count; i++)
                {
                    var value = tech.values[i];
                    if (value.name.Equals("name"))
                        continue;
                    float r = float.Parse(value.value);
                    if (r < maxRFactor) continue;
                    if (ResearchAndDevelopment.GetTechnologyState(value.name) != RDTech.State.Available) continue;
                    maxRFactor = r;
                }
            }

            if (radialFactor > maxRFactor) radialFactor = maxRFactor;
        }