Esempio n. 1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 8 && translator.Assignable <PackSystem.ItemType>(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6) && (LuaAPI.lua_isnil(L, 7) || LuaAPI.lua_type(L, 7) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 8) || LuaAPI.lua_type(L, 8) == LuaTypes.LUA_TSTRING))
                {
                    PackSystem.ItemType _item_type; translator.Get(L, 2, out _item_type);
                    int    _id           = LuaAPI.xlua_tointeger(L, 3);
                    string _name         = LuaAPI.lua_tostring(L, 4);
                    float  _buyprice     = (float)LuaAPI.lua_tonumber(L, 5);
                    float  _sellprice    = (float)LuaAPI.lua_tonumber(L, 6);
                    string _introduction = LuaAPI.lua_tostring(L, 7);
                    string _icon         = LuaAPI.lua_tostring(L, 8);

                    PackSystem.Item gen_ret = new PackSystem.Item(_item_type, _id, _name, _buyprice, _sellprice, _introduction, _icon);
                    translator.Push(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 PackSystem.Item constructor!"));
        }
Esempio n. 2
0
        static int _g_get_ID(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                PackSystem.Item gen_to_be_invoked = (PackSystem.Item)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.ID);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
        static int _m_GetData_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    string _name = LuaAPI.lua_tostring(L, 1);

                    PackSystem.Item gen_ret = PackSystem.ItemModel.GetData(_name);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_StoreData_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    string          _name    = LuaAPI.lua_tostring(L, 1);
                    PackSystem.Item _theitem = (PackSystem.Item)translator.GetObject(L, 2, typeof(PackSystem.Item));

                    PackSystem.ItemModel.StoreData(_name, _theitem);



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