public void LogTerminal(string[] table) { if (IsTrackTerminalLog) { AddResult(CStringUtils.Join(table)); } }
public void TestDelegateActionCommand() { Lunar.RegisterCommand("action", (string[] args) => { AddResult("action: {0}", CStringUtils.Join(args, ", ")); }); Execute("action arg1 arg2 arg3"); AssertResult("action: arg1, arg2, arg3"); }
public void TestBool3() { Lunar.RegisterCommand("action", (bool[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); }); Execute("action 1 0 1"); AssertResult("action True False True"); }
public void TestFloat3() { Lunar.RegisterCommand("action", (float[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); }); Execute("action 3.14 3.15 3.16"); AssertResult("action 3.14 3.15 3.16"); }
public void TestInts3() { Lunar.RegisterCommand("action", (int[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); }); Execute("action 10 20 30"); AssertResult("action 10 20 30"); }
public void TestStrings3() { Lunar.RegisterCommand("action", (string[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); }); Execute("action arg1 arg2 arg3"); AssertResult("action arg1 arg2 arg3"); }
public void TestBool2Ex() { Lunar.RegisterCommandEx("action", (bool[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); return(true); }); Execute("action 1 0"); AssertResult("action True False"); }
public void TestFloat2Ex() { Lunar.RegisterCommandEx("action", (float[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); return(true); }); Execute("action 3.14 3.15"); AssertResult("action 3.14 3.15"); }
public void TestInts1Ex() { Lunar.RegisterCommandEx("action", (int[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); return(true); }); Execute("action 10"); AssertResult("action 10"); }
public void TestStrings2Ex() { Lunar.RegisterCommandEx("action", (string[] args) => { AddResult("action " + CStringUtils.Join(args, " ")); return(true); }); Execute("action arg1 arg2"); AssertResult("action arg1 arg2"); }
protected virtual String[] GetUsageArgs() { if (m_values != null && m_values.Length > 0) { return(new String[] { " " + CStringUtils.Join(m_values, "|") }); } if (executeMethods == null) { executeMethods = resolveExecuteMethods(); } if (executeMethods.Length > 0) { String[] result = new String[executeMethods.Length]; for (int i = 0; i < result.Length; ++i) { result[i] = CCommandUtils.GetMethodParamsUsage(executeMethods[i]); } return(result); } return(null); }
protected string Join <T>(string separator, IList <T> list) { return(CStringUtils.Join(list, separator)); }
void Execute(bool[] args) { m_result.Add("bools " + CStringUtils.Join(args)); }
void Execute(float[] args) { m_result.Add("floats " + CStringUtils.Join(args)); }
void Execute(int[] args) { m_result.Add("ints " + CStringUtils.Join(args)); }
void Execute(string[] args) { m_result.Add("strings " + CStringUtils.Join(args)); }