mlaumcherb/Млаумчерб.Клиент/классы/Пути.cs
2024-09-29 08:21:48 +05:00

39 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Млаумчерб.Клиент.видимое;
namespace Млаумчерб.Клиент.классы;
public static class Пути
{
public static IOPath GetAssetIndexFilePath(string id) =>
Path.Concat(Приложение.Настройки.путь_к_кубачу, $"assets/indexes/{id}.json");
public static IOPath GetVersionDescriptorDir() =>
Path.Concat(Приложение.Настройки.путь_к_кубачу, "version_descriptors");
public static string GetVersionDescriptorName(IOPath path) =>
path.LastName().RemoveExtension().ToString();
public static IOPath GetVersionDescriptorPath(string name) =>
Path.Concat(GetVersionDescriptorDir(), Path.ReplaceRestrictedChars(name) + ".json");
public static IOPath GetVersionDir(string id) =>
Path.Concat(Приложение.Настройки.путь_к_кубачу, "versions", id);
public static IOPath GetVersionJarFilePath(string id) =>
Path.Concat(GetVersionDir(id), id + ".jar");
public static IOPath GetLibrariesDir() =>
Path.Concat(Приложение.Настройки.путь_к_кубачу, "libraries");
public static IOPath GetJavaRuntimesDir() =>
Path.Concat(Приложение.Настройки.путь_к_кубачу, "java");
public static IOPath GetJavaRuntimeDir(string id) =>
Path.Concat(GetJavaRuntimesDir(), id);
public static IOPath GetJavaExecutablePath(string id) =>
Path.Concat(GetJavaRuntimeDir(id), "bin",
OperatingSystem.IsWindows() ? "javaw.exe" : "javaw");
}