Example #1
0
        public InitTable findData(string name)
        {
            LuaObject obj = findData <LuaObject>(name);
            InitTable it  = new InitTable(obj);

            return(it);
        }
Example #2
0
        public InitTable findData(int index)
        {
            LuaObject obj = findData <LuaObject>(index);
            InitTable it  = new InitTable(obj);

            return(it);
        }
Example #3
0
        public InitTable findDataOr(int index, InitTable def)
        {
            LuaObject obj = findDataOr <LuaObject>(index, null);

            if (obj == null)
            {
                return(def);
            }

            InitTable it = new InitTable(obj);

            return(it);
        }
Example #4
0
        public InitTable findDataOr(String name, InitTable def)
        {
            LuaObject obj = findDataOr <LuaObject>(name, null);

            if (obj == null)
            {
                return(def);
            }

            InitTable it = new InitTable(obj);

            return(it);
        }
Example #5
0
        public T findData <T>(int index)
        {
            if (contains(index) == false)
            {
                throw new Exception(String.Format("Cannot find table index {0}", index));
            }

            if (typeof(T) == typeof(InitTable))
            {
                LuaObject obj = get <LuaObject>(index);
                obj.push();
                InitTable tab = new InitTable(obj.state, -1);
                return((T)Convert.ChangeType(tab, typeof(T)));
            }
            else
            {
                return(get <T>(index));
            }
        }
Example #6
0
 void createGlobalTable()
 {
     LuaDLL.lua_getglobal(myVm.statePtr, "_G");
     myGlobalTable = new InitTable(myVm, -1);
 }