Пример #1
0
        static int _g_get_IsString(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                LitJson.IJsonWrapper gen_to_be_invoked = (LitJson.IJsonWrapper)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsString);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Пример #2
0
        public LitJson.IJsonWrapper __Gen_Delegate_Imp32()
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;

            PCall(L, 0, 1, errFunc);


            LitJson.IJsonWrapper __gen_ret = (LitJson.IJsonWrapper)translator.GetObject(L, errFunc + 1, typeof(LitJson.IJsonWrapper));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Пример #3
0
        static int _m_GetDouble(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LitJson.IJsonWrapper gen_to_be_invoked = (LitJson.IJsonWrapper)translator.FastGetCSObj(L, 1);



                {
                    double gen_ret = gen_to_be_invoked.GetDouble(  );
                    LuaAPI.lua_pushnumber(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #4
0
        static int _m_ToWrapper_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <LitJson.WrapperFactory>(L, 1) && translator.Assignable <LitJson.JsonReader>(L, 2))
                {
                    LitJson.WrapperFactory _factory = translator.GetDelegate <LitJson.WrapperFactory>(L, 1);
                    LitJson.JsonReader     _reader  = (LitJson.JsonReader)translator.GetObject(L, 2, typeof(LitJson.JsonReader));

                    LitJson.IJsonWrapper gen_ret = LitJson.JsonMapper.ToWrapper(_factory, _reader);
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <LitJson.WrapperFactory>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    LitJson.WrapperFactory _factory = translator.GetDelegate <LitJson.WrapperFactory>(L, 1);
                    string _json = LuaAPI.lua_tostring(L, 2);

                    LitJson.IJsonWrapper gen_ret = LitJson.JsonMapper.ToWrapper(_factory, _json);
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to LitJson.JsonMapper.ToWrapper!"));
        }
Пример #5
0
        static int _m_SetString(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LitJson.IJsonWrapper gen_to_be_invoked = (LitJson.IJsonWrapper)translator.FastGetCSObj(L, 1);



                {
                    string _val = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.SetString(_val);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #6
0
        static int _m_SetJsonType(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LitJson.IJsonWrapper gen_to_be_invoked = (LitJson.IJsonWrapper)translator.FastGetCSObj(L, 1);



                {
                    LitJson.JsonType _type; translator.Get(L, 2, out _type);

                    gen_to_be_invoked.SetJsonType(_type);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #7
0
        static int _m_ToJson(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LitJson.IJsonWrapper gen_to_be_invoked = (LitJson.IJsonWrapper)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    string gen_ret = gen_to_be_invoked.ToJson(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <LitJson.JsonWriter>(L, 2))
                {
                    LitJson.JsonWriter _writer = (LitJson.JsonWriter)translator.GetObject(L, 2, typeof(LitJson.JsonWriter));

                    gen_to_be_invoked.ToJson(_writer);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to LitJson.IJsonWrapper.ToJson!"));
        }