Ejemplo n.º 1
0
    static int _CreateShibaInu_Random(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                ShibaInu.Random obj = new ShibaInu.Random();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                int             arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                ShibaInu.Random obj  = new ShibaInu.Random(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ShibaInu.Random.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
    static int set_Seed(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.Random obj  = (ShibaInu.Random)o;
            int             arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.Seed = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Seed on a nil value"));
        }
    }
Ejemplo n.º 3
0
    static int get_Seed(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.Random obj = (ShibaInu.Random)o;
            int             ret = obj.Seed;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Seed on a nil value"));
        }
    }
Ejemplo n.º 4
0
    static int NextFloat(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                ShibaInu.Random obj = (ShibaInu.Random)ToLua.CheckObject <ShibaInu.Random>(L, 1);
                float           o   = obj.NextFloat();
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else if (count == 2)
            {
                ShibaInu.Random obj  = (ShibaInu.Random)ToLua.CheckObject <ShibaInu.Random>(L, 1);
                float           arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
                float           o    = obj.NextFloat(arg0);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else if (count == 3)
            {
                ShibaInu.Random obj  = (ShibaInu.Random)ToLua.CheckObject <ShibaInu.Random>(L, 1);
                float           arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
                float           arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                float           o    = obj.NextFloat(arg0, arg1);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ShibaInu.Random.NextFloat"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }