예제 #1
0
        static public int GetClass(IntPtr l)
        {
            try {
                string cls;
                checkType(l, 1, out cls);
                Type t = LuaObject.FindType(cls);
                if (t == null)
                {
                    return(error(l, "Can't find {0} to create", cls));
                }

                LuaClassObject co = new LuaClassObject(t);
                pushValue(l, true);
                LuaObject.pushObject(l, co);
                return(2);
            }
            catch (Exception e) {
                return(error(l, e));
            }
        }
예제 #2
0
        public static int ImportCSharpType(IntPtr l)
        {
            try
            {
                string cls;
                Helper.checkType(l, 1, out cls);
                Type t = LuaObject.FindType(cls);
                if (t == null)
                {
                    return Helper.error(l, "Can't find {0} to create", cls);
                }

                LuaClassObject co = new LuaClassObject(t);
                LuaObject.pushObject(l,co);
                Helper.pushValue(l, true);
                return 2;
            }
            catch (Exception e)
            {
                return Helper.error(l, e);
            }
        }
예제 #3
0
        public static int GetClass(IntPtr ptr)
        {
            try
            {
                string cls;
                CheckType(ptr, 1, out cls);
                Type t = LuaObject.FindType(cls);
                if (t == null)
                {
                    return(Error(ptr, "Can't find {0} to create", cls));
                }

                LuaClassObject co = new LuaClassObject(t);
                LuaObject.PushValue(ptr, true);
                LuaObject.PushObject(ptr, co);
                return(2);
            }
            catch (Exception e)
            {
                return(Error(ptr, e));
            }
        }
예제 #4
0
파일: Helper.cs 프로젝트: zhaoluxyz/slua
        static public int GetClass(IntPtr l)
        {
            try
            {
                string cls;
                checkType(l, 1, out cls);
                Type t = Type.GetType(cls);
                if (t == null)
                {
                    LuaDLL.luaL_error(l, "Can't find {0} to create", cls);
                    return(0);
                }

                LuaClassObject co = new LuaClassObject(t);
                LuaObject.pushObject(l, co);

                return(1);
            }
            catch (Exception e)
            {
                LuaDLL.luaL_error(l, e.ToString());
                return(0);
            }
        }
예제 #5
0
        public static int GetClass(IntPtr l)
        {
            try
            {
                string cls;
                checkType(l, 1, out cls);
                Type t = Type.GetType(cls);
                if (t == null)
                {
                    return error(l, "Can't find {0} to create", cls);
                }

                LuaClassObject co = new LuaClassObject(t);
                pushValue(l, true);
                LuaObject.pushObject(l,co);
                return 2;
            }
            catch (Exception e)
            {
                return error(l, e);
            }
        }
예제 #6
0
파일: Helper.cs 프로젝트: huangkumao/slua
        public static int GetClass(IntPtr l)
        {
            try
            {
                string cls;
                checkType(l, 1, out cls);
                Type t = Type.GetType(cls);
                if (t == null)
                {
                    LuaDLL.luaL_error(l, "Can't find {0} to create", cls);
                    return 0;
                }

                LuaClassObject co = new LuaClassObject(t);
                LuaObject.pushObject(l,co);

                return 1;
            }
            catch (Exception e)
            {
                LuaDLL.luaL_error(l, e.ToString());
                return 0;
            }
        }