public void ExecuteConFile(VFile file) { var commands = file.ReadAllLines(); foreach (var command in commands) { var data = command.Split(' '); if (string.IsNullOrEmpty(data[0]) || string.IsNullOrWhiteSpace(data[0])) { continue; } if (data[0].StartsWith("rem")) { continue; } if (data[0] == "if") { InIf = true; continue; } if (InIf && (data[0] == "else" || data[0] == "endIf")) { InIf = false; continue; } if (InIf) { continue; } if (data[0] == "endIf") { continue; } if (!registeredMethods.ContainsKey(data[0])) { Console.WriteLine("[CONPROCESSOR] Unknown con function: " + command); continue; } var variable1 = data[1]; if (variable1.StartsWith(Convert.ToString('"'))) { for (int i = 2; i < data.Length; i++) { variable1 += data[i]; if (data[i].EndsWith(Convert.ToString('"'))) { break; } } } string variable2 = null; if (data.Length > 2) { variable2 = data[2]; if (variable2.StartsWith(Convert.ToString('"'))) { for (int i = 2; i < data.Length; i++) { variable2 += data[i]; if (data[i].EndsWith(Convert.ToString('"'))) { break; } } } } registeredMethods[data[0]](variable1, variable2); } }