本文整理汇总了C#中System.ConfigNode.GetFloatValuesCSV方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigNode.GetFloatValuesCSV方法的具体用法?C# ConfigNode.GetFloatValuesCSV怎么用?C# ConfigNode.GetFloatValuesCSV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ConfigNode
的用法示例。
在下文中一共展示了ConfigNode.GetFloatValuesCSV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EngineClusterLayoutData
public EngineClusterLayoutData(SSTUEngineLayout layoutData, ConfigNode node, float engineScale, float moduleEngineSpacing, float moduleMountSize, float increment, bool upperMounts, bool lowerMounts)
{
this.engineScale = engineScale;
this.layoutData = layoutData;
layoutName = layoutData.name;
defaultMount = lowerMounts? layoutData.defaultLowerStageMount : layoutData.defaultUpperStageMount;
engineSpacing = moduleEngineSpacing;
Dictionary<String, ConfigNode> localMountNodes = new Dictionary<String, ConfigNode>();
Dictionary<String, SSTUEngineLayoutMountOption> globalMountOptions = new Dictionary<String, SSTUEngineLayoutMountOption>();
List<ConfigNode> customMounts = new List<ConfigNode>();
String name;
ConfigNode mountNode;
SSTUEngineLayoutMountOption mountOption;
int len = layoutData.mountOptions.Length;
for (int i = 0; i < len; i++)
{
mountOption = layoutData.mountOptions[i];
if ((mountOption.upperStage && upperMounts) || (mountOption.lowerStage && lowerMounts))
{
globalMountOptions.Add(mountOption.mountName, mountOption);
}
}
if (node != null)
{
//override data from the config node
defaultMount = node.GetStringValue("defaultMount", defaultMount);
engineSpacing = node.GetFloatValue("engineSpacing", engineSpacing);
engineRotationOverride = node.GetFloatValuesCSV("rotateEngines", engineRotationOverride);
ConfigNode[] mountNodes = node.GetNodes("MOUNT");
len = mountNodes.Length;
for (int i = 0; i < len; i++)
{
mountNode = mountNodes[i];
name = mountNode.GetStringValue("name");
if (mountNode.GetBoolValue("remove", false))
{
globalMountOptions.Remove(name);
}
else
{
if (!globalMountOptions.ContainsKey(name))
{
customMounts.Add(mountNode);
}
localMountNodes.Add(name, mountNode);
}
}
}
engineSpacing = engineSpacing * engineScale;//pre-scale the engine spacing by the engine scale value; needed for engine positioning and mount-size calculation
moduleMountSize = moduleMountSize * engineScale;//pre-scale the mount size by the engine scale value; needed for mount-size calculation
List<EngineClusterLayoutMountData> mountDataTemp = new List<EngineClusterLayoutMountData>();
foreach(String key in globalMountOptions.Keys)
{
if (localMountNodes.ContainsKey(key))//was specified in the config and was not a simple removal; merge values into global node...
{
mountNode = mergeNodes(getAutoSizeNode(globalMountOptions[key], engineSpacing, moduleMountSize, increment), localMountNodes[key]);
}
else
{
mountNode = getAutoSizeNode(globalMountOptions[key], engineSpacing, moduleMountSize, increment);
}
mountDataTemp.Add(new EngineClusterLayoutMountData(mountNode));
}
foreach (ConfigNode cm in customMounts)
{
mountDataTemp.Add(new EngineClusterLayoutMountData(cm));
}
mountData = mountDataTemp.ToArray();
}
示例2: EngineClusterLayoutMountData
public EngineClusterLayoutMountData(ConfigNode node)
: base(node)
{
canAdjustSize = node.GetBoolValue("canAdjustSize", canAdjustSize);
initialDiameter = node.GetFloatValue("size", initialDiameter);
minDiameter = node.GetFloatValue("minSize", initialDiameter);
maxDiameter = node.GetFloatValue("maxSize", initialDiameter);
rotateEngines = node.GetFloatValuesCSV("rotateEngines", new float[] {});
engineSpacing = node.GetFloatValue("engineSpacing", engineSpacing);
if (String.IsNullOrEmpty(modelDefinition.modelName)) { canAdjustSize = false; }
}