Exemple #1
0
 public void LogTerminal(string[] table)
 {
     if (IsTrackTerminalLog)
     {
         AddResult(CStringUtils.Join(table));
     }
 }
Exemple #2
0
        public void TestDelegateActionCommand()
        {
            Lunar.RegisterCommand("action", (string[] args) =>
            {
                AddResult("action: {0}", CStringUtils.Join(args, ", "));
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action: arg1, arg2, arg3");
        }
Exemple #3
0
        public void TestBool3()
        {
            Lunar.RegisterCommand("action", (bool[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
            });

            Execute("action 1 0 1");
            AssertResult("action True False True");
        }
Exemple #4
0
        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");
        }
Exemple #5
0
        public void TestInts3()
        {
            Lunar.RegisterCommand("action", (int[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
            });

            Execute("action 10 20 30");
            AssertResult("action 10 20 30");
        }
Exemple #6
0
        public void TestStrings3()
        {
            Lunar.RegisterCommand("action", (string[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action arg1 arg2 arg3");
        }
Exemple #7
0
        public void TestBool2Ex()
        {
            Lunar.RegisterCommandEx("action", (bool[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 1 0");
            AssertResult("action True False");
        }
Exemple #8
0
        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");
        }
Exemple #9
0
        public void TestInts1Ex()
        {
            Lunar.RegisterCommandEx("action", (int[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 10");
            AssertResult("action 10");
        }
Exemple #10
0
        public void TestStrings2Ex()
        {
            Lunar.RegisterCommandEx("action", (string[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action arg1 arg2");
            AssertResult("action arg1 arg2");
        }
Exemple #11
0
        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);
        }
Exemple #12
0
 protected string Join <T>(string separator, IList <T> list)
 {
     return(CStringUtils.Join(list, separator));
 }
Exemple #13
0
 void Execute(bool[] args)
 {
     m_result.Add("bools " + CStringUtils.Join(args));
 }
Exemple #14
0
 void Execute(float[] args)
 {
     m_result.Add("floats " + CStringUtils.Join(args));
 }
Exemple #15
0
 void Execute(int[] args)
 {
     m_result.Add("ints " + CStringUtils.Join(args));
 }
Exemple #16
0
 void Execute(string[] args)
 {
     m_result.Add("strings " + CStringUtils.Join(args));
 }