Exemplo n.º 1
0
    static int _CreateOneByOne_FightSoldierModel(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            OneByOne.FightSoldierModel obj = new OneByOne.FightSoldierModel();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: OneByOne.FightSoldierModel.New");
        }

        return(0);
    }
Exemplo n.º 2
0
    static int get_speed(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        OneByOne.FightSoldierModel obj = (OneByOne.FightSoldierModel)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name speed");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index speed on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.speed);
        return(1);
    }
Exemplo n.º 3
0
    static int set_code(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        OneByOne.FightSoldierModel obj = (OneByOne.FightSoldierModel)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name code");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index code on a nil value");
            }
        }

        obj.code = (int)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }