Beispiel #1
0
    static int get_Value(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CSCell obj = (CSCell)o;
            int    ret = obj.Value;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Value on a nil value"));
        }
    }
Beispiel #2
0
    static int set_X(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CSCell obj  = (CSCell)o;
            int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.X = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index X on a nil value"));
        }
    }
Beispiel #3
0
    static int _CreateCSCell(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                CSCell obj = new CSCell();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: CSCell.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }