Beispiel #1
0
 /// <summary>
 /// Read in the towers from the given filestream.
 /// </summary>
 /// <param name="f"></param>
 public static void LoadTowers(FileStream f)
 {
     byte[] bytes = new byte[Tower.TowerDataSize];
     f.Read(bytes, 0, 1);
     // Check that there are any towers to iterate through.
     if (bytes[0] != Byte.MaxValue)
     {
         f.Seek(-1, SeekOrigin.Current);
         f.Read(bytes, 0, Tower.TowerDataSize);
         // Iterate and add towers until the end of the towers section is reached.
         while (bytes[0] != Byte.MaxValue)
         {
             AddTower(Tower.LoadFromByteArray(bytes));
             f.Read(bytes, 0, Tower.TowerDataSize);
         }
     }
     LoadProgress += 0.1f;
 }