예제 #1
0
 private static void ProcessLevel(string path, LevelLocation location)
 {
     try
     {
         Main.SpecialCode = "Loading Level " + path != null ? path : "null";
         if (!path.EndsWith(".lev"))
         {
             return;
         }
         path = path.Replace('\\', '/');
         LevelData dat = location != LevelLocation.Content ? DuckFile.LoadLevel(path) : DuckFile.LoadLevel(DuckFile.ReadEntireStream(TitleContainer.OpenStream(path)));
         if (dat != null)
         {
             dat.SetPath(path);
             path = path.Substring(0, path.Length - 4);
             path.Substring(path.IndexOf("/levels/") + 8);
             if (dat.metaData.guid != null)
             {
                 DuckGame.Content.MapLevel(dat.metaData.guid, dat, location);
             }
         }
         ++MonoMain.loadyBits;
     }
     catch (Exception ex)
     {
         DuckGame.Content.LogLevelFailure(ex.ToString());
     }
 }