public InitTable findData(string name) { LuaObject obj = findData <LuaObject>(name); InitTable it = new InitTable(obj); return(it); }
public InitTable findData(int index) { LuaObject obj = findData <LuaObject>(index); InitTable it = new InitTable(obj); return(it); }
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); }
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); }
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)); } }
void createGlobalTable() { LuaDLL.lua_getglobal(myVm.statePtr, "_G"); myGlobalTable = new InitTable(myVm, -1); }