using System; using System.Collections.Generic; using System.Reflection; namespace BepInEx.Common { /// /// Generic helper properties and methods. /// [Obsolete("This class has moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static class Utility { /// /// The directory that the game .exe is being run from. /// [Obsolete("This property has been moved, please use Paths.GameRootPath instead", true)] public static string ExecutingDirectory => Paths.GameRootPath; /// /// The path that the plugins folder is located. /// [Obsolete("This property has been moved, please use Paths.PluginPath instead", true)] public static string PluginsDirectory => Paths.PluginPath; /// /// Combines multiple paths together, as the specfic method is not availble in .NET 3.5. /// /// The multiple paths to combine together. /// A combined path. [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static string CombinePaths(params string[] parts) => BepInEx.Utility.CombinePaths(parts); /// /// Tries to parse a bool, with a default value if unable to parse. /// /// The string to parse /// The value to return if parsing is unsuccessful. /// Boolean value of input if able to be parsed, otherwise default value. [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static bool SafeParseBool(string input, bool defaultValue = false) => BepInEx.Utility.SafeParseBool(input, defaultValue); /// /// Converts a file path into a UnityEngine.WWW format. /// /// The file path to convert. /// A converted file path. [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static string ConvertToWWWFormat(string path) => BepInEx.Utility.ConvertToWWWFormat(path); /// /// Indicates whether a specified string is null, empty, or consists only of white-space characters. /// /// The string to test. /// True if the value parameter is null or empty, or if value consists exclusively of white-space characters. [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static bool IsNullOrWhiteSpace(this string self) => BepInEx.Utility.IsNullOrWhiteSpace(self); [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static IEnumerable TopologicalSort(IEnumerable nodes, Func> dependencySelector) => BepInEx.Utility.TopologicalSort(nodes, dependencySelector); /// /// Try to resolve and load the given assembly DLL. /// /// Name of the assembly, of the type . /// Directory to search the assembly from. /// The loaded assembly. /// True, if the assembly was found and loaded. Otherwise, false. [Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)] public static bool TryResolveDllAssembly(AssemblyName assemblyName, string directory, out Assembly assembly) => BepInEx.Utility.TryResolveDllAssembly(assemblyName, directory, out assembly); } }