public bool EqualsModExactVersion(Mod mod, BeatSaberInstalledType type) { return(mod.GetPluginBinaryFile(type) == binaryFile); /*return string.Compare(Name, mod.Name, StringComparison.OrdinalIgnoreCase) == 0 && * string.Compare(Version, mod.Version, StringComparison.OrdinalIgnoreCase) == 0;*/ }
public Download GetBestDownloadFor(BeatSaberInstalledType type) { if (!downloads.Any((m) => type == m.Type) && (type != BeatSaberInstalledType.Universal)) { return(downloads.FirstOrDefault((m) => BeatSaberInstalledType.Universal == m.Type)); } else { return(downloads.FirstOrDefault((m) => type == m.Type)); } }
/*[Obsolete] * public LocalMod(string id, string name, string version, Mod.Download.File binaryFile, bool preventRemoval = false) * { * Id = id; * Name = name; * Version = version; * this.binaryFile = binaryFile; * this.preventRemoval = preventRemoval; * affectedFiles = new List<string>(); * usedBy = new List<string>(); * uses = new List<string>(); * }*/ public InstalledMod(Mod mod, BeatSaberInstalledType type) { Id = mod.Id; Name = mod.Name; Version = mod.Version; GameVersion = mod.GameVersion; binaryFile = mod.GetPluginBinaryFile(type); preventRemoval = mod.required; affectedFiles = mod.GetBestDownloadFor(type).archiveFiles.Select((e) => e.file).ToList(); usedBy = new List <string>(); uses = new List <string>(); }
public bool EqualsModIgnoreVersion(Mod mod, BeatSaberInstalledType type) { return(string.Compare(mod.GetPluginBinaryFile(type).file, binaryFile.file) == 0); //return string.Compare(Name, mod.Name, StringComparison.OrdinalIgnoreCase) == 0; }
public Download.File GetPluginBinaryFile(BeatSaberInstalledType type) { if (downloads.Length == 0) { return(default);