コード例 #1
0
        public void TestBoolEx()
        {
            Lunar.RegisterCommandEx("action", (bool[] args) =>
            {
                AddResult("action " + StringUtils.Join(args, " "));
                return true;
            });

            Execute("action");
            AssertResult("action ");
        }
コード例 #2
0
        public void TestFloatArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (float arg1, float arg2, float arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 3.14 3.15 3.16");
            AssertResult("action 3.14 3.15 3.16");
        }
コード例 #3
0
        public void TestBoolArg2Ex()
        {
            Lunar.RegisterCommandEx("action", (bool arg1, bool arg2) =>
            {
                AddResult("action " + arg1 + " " + arg2);
                return true;
            });

            Execute("action 1 0");
            AssertResult("action True False");
        }
コード例 #4
0
        public void TestBool3Ex()
        {
            Lunar.RegisterCommandEx("action", (bool[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 1 0 1");
            AssertResult("action True False True");
        }
コード例 #5
0
        public void TestInts3Ex()
        {
            Lunar.RegisterCommandEx("action", (int[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 10 20 30");
            AssertResult("action 10 20 30");
        }
コード例 #6
0
        public void TestFloat3Ex()
        {
            Lunar.RegisterCommandEx("action", (float[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action 3.14 3.15 3.16");
            AssertResult("action 3.14 3.15 3.16");
        }
コード例 #7
0
        public void TestVector4Ex()
        {
            Lunar.RegisterCommandEx("action", (Vector4 arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 1.0 2.0 3.0 4.0");
            AssertResult("action (1.0, 2.0, 3.0, 4.0)");
        }
コード例 #8
0
        public void TestStrings3Ex()
        {
            Lunar.RegisterCommandEx("action", (string[] args) =>
            {
                AddResult("action " + CStringUtils.Join(args, " "));
                return(true);
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action arg1 arg2 arg3");
        }
コード例 #9
0
        public void TestStringArgEx()
        {
            Lunar.RegisterCommandEx("action", (string arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action arg1");
            AssertResult("action arg1");
        }
コード例 #10
0
        public void TestStringArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (string arg1, string arg2, string arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action arg1 arg2 arg3");
            AssertResult("action arg1 arg2 arg3");
        }
コード例 #11
0
        public void TestFloatArgEx()
        {
            Lunar.RegisterCommandEx("action", (float arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 3.14");
            AssertResult("action 3.14");
        }
コード例 #12
0
        public void TestFloatArg2Ex()
        {
            Lunar.RegisterCommandEx("action", (float arg1, float arg2) =>
            {
                AddResult("action " + arg1 + " " + arg2);
                return true;
            });

            Execute("action 3.14 3.15");
            AssertResult("action 3.14 3.15");
        }
コード例 #13
0
        public void TestIntArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (int arg1, int arg2, int arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 10 20 30");
            AssertResult("action 10 20 30");
        }
コード例 #14
0
        public void TestIntArgEx()
        {
            Lunar.RegisterCommandEx("action", (int arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 10");
            AssertResult("action 10");
        }
コード例 #15
0
        public void TestBoolArg3Ex()
        {
            Lunar.RegisterCommandEx("action", (bool arg1, bool arg2, bool arg3) =>
            {
                AddResult("action " + arg1 + " " + arg2 + " " + arg3);
                return(true);
            });

            Execute("action 1 0 1");
            AssertResult("action True False True");
        }
コード例 #16
0
        public void TestBoolArgEx()
        {
            Lunar.RegisterCommandEx("action", (bool arg) =>
            {
                AddResult("action " + arg);
                return(true);
            });

            Execute("action 1");
            AssertResult("action True");
        }
コード例 #17
0
        public void TestFunctionChain()
        {
            Lunar.RegisterCommandEx("action1", () =>
            {
                AddResult("action1");
                return(true);
            });

            Lunar.RegisterCommandEx("action2", () =>
            {
                AddResult("action2");
                return(true);
            });

            Execute("action1 && action2");
            AssertResult("action1", "action2");
        }
コード例 #18
0
        public void TestFunctionBrokenChain()
        {
            Lunar.RegisterCommandEx("action1", () =>
            {
                AddResult("action1");
                return true;
            });

            Lunar.RegisterCommandEx("action2", () =>
            {
                AddResult("action2");
                return false;
            });

            Lunar.RegisterCommandEx("action3", () =>
            {
                AddResult("action3");
                return false;
            });

            Execute("action1 && action2 && action3", false);
            AssertResult("action1", "action2");
        }