Exemplo n.º 1
0
 public void LoadMiniHouseInfo()
 {
     MiniHouses = new Dictionary<ushort, MiniHouseInfo>();
     using (var file = new SHNFile(folder + @"\MiniHouse.shn"))
     {
         using (DataTableReaderEx reader = new DataTableReaderEx(file))
         {
             while (reader.Read())
             {
                 MiniHouseInfo mhi = new MiniHouseInfo(reader);
                 MiniHouses.Add(mhi.ID, mhi);
             }
         }
     }
     Log.WriteLine(LogLevel.Info, "Loaded {0} Mini Houses.", MiniHouses.Count);
 }
Exemplo n.º 2
0
 public void LoadMiniHouseInfo()
 {
     MiniHouses = new Dictionary<ushort, MiniHouseInfo>();
     DataTable houseData = null;
     using (DatabaseClient dbClient = Program.DatabaseManager.GetClient())
     {
         houseData = dbClient.ReadDataTable("SELECT *FROM minihouse");
     }
     if (houseData != null)
     {
         foreach (DataRow row in houseData.Rows)
         {
             MiniHouseInfo mhi = new MiniHouseInfo(row);
             MiniHouses.Add(mhi.ID, mhi);
         }
     }
     Log.WriteLine(LogLevel.Info, "Loaded {0} Mini Houses.", MiniHouses.Count);
 }