public static Data.Inputs.MethodParamPair GenerateMethodFromArgs(string method, string[] param, string[] paths) { MethodParamPair output = null; ExitPathGroup methodPaths = new ExitPathGroup(); for (int i = 0; i < paths.Length; i++) { var temp = paths[i].Split(';'); if (temp.Length != 2) throw new EngineException("Invalid path size",true); int rawResult = int.Parse(temp[i]), nextMethod; MethodResult result = (MethodResult)rawResult; nextMethod = int.Parse(temp[1]); methodPaths[result] = nextMethod; } switch (method.ToLower()) { case "addgold": { break; } case "conditional": { ConditionInput conditionInput = new ConditionInput(); break; } case "addexp": { break; } case "toggleswitch": { break; } case "activateswitch": { break; } case "deactivateswitch": { break; } case "showmessagebox": { string messageBoxInput = ""; for (int i = 0; i < param.Length; i++) { messageBoxInput += param[i] + "\n"; } StringInput methodInput = new StringInput() { Input = messageBoxInput }; output = new MethodParamPair(ShowMessageBox, methodInput, methodPaths); break; } default: throw new EngineException("Method name Not Found", false); } return output; }
public static Data.Inputs.MethodParamPair GenerateMethodFromArgs(string method, string[] param, string[] paths) { MethodParamPair output = null; ExitPathGroup methodPaths = new ExitPathGroup(); for (int i = 0; i < paths.Length; i++) { var temp = paths[i].Split(';'); if (temp.Length != 2) { throw new EngineException("Invalid path size", true); } int rawResult = int.Parse(temp[i]), nextMethod; MethodResult result = (MethodResult)rawResult; nextMethod = int.Parse(temp[1]); methodPaths[result] = nextMethod; } switch (method.ToLower()) { case "addgold": { break; } case "conditional": { ConditionInput conditionInput = new ConditionInput(); break; } case "addexp": { break; } case "toggleswitch": { break; } case "activateswitch": { break; } case "deactivateswitch": { break; } case "showmessagebox": { string messageBoxInput = ""; for (int i = 0; i < param.Length; i++) { messageBoxInput += param[i] + "\n"; } StringInput methodInput = new StringInput() { Input = messageBoxInput }; output = new MethodParamPair(ShowMessageBox, methodInput, methodPaths); break; } default: throw new EngineException("Method name Not Found", false); } return(output); }