/// <summary> /// Create or get the path to a special folder for a platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <param name="create">True if we should create the path on disk if it doesn't exist already</param> /// <returns>Path to the folder</returns> public static string CreatePlatformFolder(Namespace ns, Platform platform, PlatformFolder folder, bool create) { string dir_path = string.Format("{0}{1}\\", CreatePlatform(ns, platform), folder.ToString().Replace('_', '\\')); if (create && !Directory.Exists(dir_path)) Directory.CreateDirectory(dir_path); return dir_path; }
/// <summary> /// Get the relative path to a special folder for a platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <returns>Relative path to the folder</returns> public static string GetRelativePath(Namespace ns, Platform platform, PlatformFolder folder) { return string.Format("{0}{1}\\", GetRelativePath(ns, platform), folder.ToString().Replace('_', '\\')); }
/// <summary> /// Gets a complete platform folder path based on a game's namespace, and its platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <returns></returns> public static string GetPlatformFolderPath(Namespace ns, Platform platform, PlatformFolder folder) { return string.Format("{0}{1}\\{2}\\{3}\\", Program.GamesPath, ns.ToString(), platform.ToString(), folder.ToString().Replace('_', '\\')); }
/// <summary> /// Create or get the path to a special folder for a platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <param name="create">True if we should create the path on disk if it doesn't exist already</param> /// <returns>Path to the folder</returns> public static string CreatePlatformFolder(Namespace ns, Platform platform, PlatformFolder folder, bool create) { string dir_path = string.Format("{0}{1}\\", CreatePlatform(ns, platform), folder.ToString().Replace('_', '\\')); if (create && !Directory.Exists(dir_path)) { Directory.CreateDirectory(dir_path); } return(dir_path); }
/// <summary> /// Get the relative path to a special folder for a platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <returns>Relative path to the folder</returns> public static string GetRelativePath(Namespace ns, Platform platform, PlatformFolder folder) { return(string.Format("{0}{1}\\", GetRelativePath(ns, platform), folder.ToString().Replace('_', '\\'))); }
/// <summary> /// Gets a complete platform folder path based on a game's namespace, and its platform /// </summary> /// <param name="ns">Game namespace</param> /// <param name="platform">Platform folder</param> /// <param name="folder">Platform's folder. Must only have one folder flag set.</param> /// <returns></returns> public static string GetPlatformFolderPath(Namespace ns, Platform platform, PlatformFolder folder) { return(string.Format("{0}{1}\\{2}\\{3}\\", Program.GamesPath, ns.ToString(), platform.ToString(), folder.ToString().Replace('_', '\\'))); }