Ejemplo n.º 1
0
 public static string GetSaveDirectory()
 {
     if (String.IsNullOrEmpty(GameSettings.Current.SaveLocation))
     {
         return(DwarfGame.GetGameDirectory() + Path.DirectorySeparatorChar + "Saves");
     }
     else
     {
         return(GameSettings.Current.SaveLocation + Path.DirectorySeparatorChar + "Saves");
     }
 }
Ejemplo n.º 2
0
 public static string GetWorldDirectory()
 {
     if (String.IsNullOrEmpty(GameSettings.Default.SaveLocation))
     {
         return(DwarfGame.GetGameDirectory() + Path.DirectorySeparatorChar + "Worlds");
     }
     else
     {
         return(GameSettings.Default.SaveLocation + Path.DirectorySeparatorChar + "Worlds");
     }
 }
Ejemplo n.º 3
0
        public static string GetLatestSaveFile()
        {
            DirectoryInfo saveDirectory = Directory.CreateDirectory(DwarfGame.GetGameDirectory() + Path.DirectorySeparatorChar + "Saves");
            DirectoryInfo newest        = null;

            foreach (var dir in saveDirectory.EnumerateDirectories())
            {
                if (newest == null || newest.CreationTime < dir.CreationTime)
                {
                    newest = dir;
                }
            }
            return(newest == null ? null : newest.FullName);
        }