예제 #1
0
        public ServiceModuleCoreModel(ConfigNode node) : base(node)
        {
            topRatio       = modelDefinition.configNode.GetFloatValue("topRatio", topRatio);
            bottomRatio    = modelDefinition.configNode.GetFloatValue("bottomRatio", bottomRatio);
            rcsOffsetRange = modelDefinition.configNode.GetFloatValue("rcsOffsetRange", 0f);
            rcsPosition    = modelDefinition.configNode.GetFloatValue("rcsPosition", 0f);
            ConfigNode[] solarNodes = modelDefinition.configNode.GetNodes("SOLAR");
            int          len        = solarNodes.Length;

            solarConfigs = new ServiceModuleSolarPanelConfiguration[len];
            for (int i = 0; i < len; i++)
            {
                solarConfigs[i] = new ServiceModuleSolarPanelConfiguration(solarNodes[i]);
            }
        }
예제 #2
0
        /// <summary>
        /// Returns if the input solar panel variant is a valid option at the input scale
        /// </summary>
        /// <param name="name"></param>
        /// <param name="scale"></param>
        /// <returns></returns>
        public bool isValidSolarOption(string name, float scale)
        {
            ServiceModuleSolarPanelConfiguration config = getPanelConfiguration(name);

            return(scale >= config.minScale);
        }