private static SSequenceConfig GetConfig(string[] pLines) { SSequenceConfig config = new SSequenceConfig(); config.path = GetValue(pLines[0]); config.treeHeight = int.Parse(GetValue(pLines[1])); config.treeExtent = float.Parse(GetValue(pLines[2])); config.treeExtentMultiply = float.Parse(GetValue(pLines[3])); return(config); }
public static void SetValues() { if (configs.Count == 0) { return; } CDebug.WriteLine("SetValues from config"); SSequenceConfig currentConfig = configs[currentConfigIndex]; CParameterSetter.SetParameter(ESettings.forestFileFullName, currentConfig.path); int treeHeight = currentConfig.treeHeight; CParameterSetter.SetParameter(ESettings.autoAverageTreeHeight, treeHeight <= 0); if (treeHeight > 0) { CParameterSetter.SetParameter(ESettings.avgTreeHeigh, treeHeight); } CParameterSetter.SetParameter(ESettings.treeExtent, currentConfig.treeExtent); CParameterSetter.SetParameter(ESettings.treeExtentMultiply, currentConfig.treeExtentMultiply); }
public static void Init() { configs = new List <SSequenceConfig>(); currentConfigIndex = 0; if (!IsSequence()) { return; } lastSequenceFile = CParameterSetter.GetStringSettings(ESettings.forestFileFullName); string[] lines = File.ReadAllLines(lastSequenceFile); for (int i = 0; i < lines.Length; i += oneSequenceLength) { string[] configLines = new string[oneSequenceLength]; configLines[0] = lines[i]; configLines[1] = lines[i + 1]; configLines[2] = lines[i + 2]; configLines[3] = lines[i + 3]; SSequenceConfig config = GetConfig(configLines); configs.Add(config); } }