using EvilEngine.Adapters.Steam; using EvilEngine.Conversion; using EvilEngine.Mounts; namespace EvilEngine.Adapters.GoldSrc; public sealed class GoldSrc : IAdapter { public static readonly GoldSrcRow HalfLife = new("half-life", "70", GoldSrcGame.BaseFolder, "Half-Life"); public static IReadOnlyList Rows { get; } = [HalfLife]; public void Register(AdapterContext context) { foreach (var row in Rows) { context.AddGame(new GoldSrcGame(row)); context.AddConverter(row.Key, new MusicFileConverter()); context.AddConverter(row.Key, new SoundtrackRecords([new SoundtrackFolder(GoldSrcGame.MediaFolder)], layer => OwnLayer(row, layer) ? new SoundtrackGame(row.Title, $"{SteamFinder.StoreName}:app/{row.AppId}") : null)); } } private static bool OwnLayer(GoldSrcRow row, string layer) { var folder = layer.Split(VirtualPath.Separator)[0]; return folder.Equals(row.Folder, StringComparison.OrdinalIgnoreCase) || folder.Equals($"{row.Folder}_hd", StringComparison.OrdinalIgnoreCase); } }