/// <summary> /// 获取全部数据 /// </summary> /// <returns></returns> public static List <MhxyMapExit> GetAll() { List <MhxyMap> maps = MhxyMap.GetAll(); List <MhxyMapExit> ret = new List <MhxyMapExit>(); string sql = "select * from mhxy_map_exit"; SQLiteConnection conn = SQLiteUtil.GetConn(); conn.Open(); DataSet ds = SQLiteHelper.ExecuteDataSet(conn, sql, null); conn.Close(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { MhxyMapExit mt = new MhxyMapExit(); mt.id = Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString()); mt.map_id = Convert.ToInt32(ds.Tables[0].Rows[i]["map_id"].ToString()); mt.to_map_id = Convert.ToInt32(ds.Tables[0].Rows[i]["to_map_id"].ToString()); mt.x = Convert.ToInt32(ds.Tables[0].Rows[i]["x"].ToString()); mt.y = Convert.ToInt32(ds.Tables[0].Rows[i]["y"].ToString()); mt.wait_x = Convert.ToInt32(ds.Tables[0].Rows[i]["wait_x"].ToString()); mt.wait_y = Convert.ToInt32(ds.Tables[0].Rows[i]["wait_y"].ToString()); mt.remarks = ds.Tables[0].Rows[i]["remarks"].ToString(); mt.npc_id = Convert.ToInt32(ds.Tables[0].Rows[i]["npc_id"].ToString()); mt.call_npc_option = Convert.ToInt32(ds.Tables[0].Rows[i]["call_npc_option"].ToString()); for (int j = 0; j < maps.Count; j++) { if (mt.map_id == maps[j].id) { mt.myMap = maps[j]; } if (mt.to_map_id == maps[j].id) { mt.toMap = maps[j]; } } ret.Add(mt); } return(ret); }
/// <summary> /// 加载全部地图数据 /// </summary> /// <returns></returns> public static List <MhxyMap> GetAll() { List <MhxyMap> ret = new List <MhxyMap>(); string sql = "select * from mhxy_map"; SQLiteConnection conn = SQLiteUtil.GetConn(); conn.Open(); DataSet ds = SQLiteHelper.ExecuteDataSet(conn, sql, null); conn.Close(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { MhxyMap mt = new MhxyMap(); mt.id = Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString()); mt.map_no = Convert.ToInt32(ds.Tables[0].Rows[i]["map_no"].ToString()); mt.name = ds.Tables[0].Rows[i]["name"].ToString(); mt.parent_id = Convert.ToInt32(ds.Tables[0].Rows[i]["parent_id"].ToString()); ret.Add(mt); } return(ret); }