public void Init(CSMap data) { m_map = new byte[data.Width, data.Height]; foreach (CSCell cell in data.Cells.ToArray()) { m_map[cell.X, cell.Y] = (byte)(cell.Value - 1); } }
static int Init(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); LuaAStar obj = (LuaAStar)ToLua.CheckObject <LuaAStar>(L, 1); CSMap arg0 = (CSMap)ToLua.CheckObject <CSMap>(L, 2); obj.Init(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_Width(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); CSMap obj = (CSMap)o; int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.Width = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Width on a nil value")); } }
static int get_Cells(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); CSMap obj = (CSMap)o; LuaInterface.LuaTable ret = obj.Cells; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Cells on a nil value")); } }
static int get_Height(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); CSMap obj = (CSMap)o; int ret = obj.Height; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Height on a nil value")); } }
static int set_Cells(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); CSMap obj = (CSMap)o; LuaTable arg0 = ToLua.CheckLuaTable(L, 2); obj.Cells = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Cells on a nil value")); } }
static int _CreateCSMap(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { CSMap obj = new CSMap(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: CSMap.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }