From 2ae860e8cab827b6cbbb5d9a21f6da73f23b228c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 17 Jul 2021 21:17:45 -0700 Subject: [PATCH] Add Tivola Ring Protection detection (fixes #45) --- .../ProtectionType/TivolaRingProtection.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 BurnOutSharp/ProtectionType/TivolaRingProtection.cs diff --git a/BurnOutSharp/ProtectionType/TivolaRingProtection.cs b/BurnOutSharp/ProtectionType/TivolaRingProtection.cs new file mode 100644 index 00000000..97bf19d1 --- /dev/null +++ b/BurnOutSharp/ProtectionType/TivolaRingProtection.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using System.IO; +using BurnOutSharp.Matching; + +namespace BurnOutSharp.ProtectionType +{ + /// + /// This protection needs far more research + /// + public class TivolaRingProtection : IPathCheck + { + /// + public List CheckDirectoryPath(string path, IEnumerable files) + { + var matchers = new List + { + new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection"), + }; + + return MatchUtil.GetAllMatches(files, matchers, any: true); + } + + /// + public string CheckFilePath(string path) + { + var matchers = new List + { + new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection"), + }; + + return MatchUtil.GetFirstMatch(path, matchers, any: true); + } + } +}