[+] 通用特征替换的数据结构与查找方法

This commit is contained in:
huiyadanli
2019-12-25 01:13:09 +08:00
parent fa4b15d7d2
commit 818a7e1dbd
7 changed files with 96 additions and 10 deletions

View File

@@ -14,6 +14,11 @@ namespace RevokeMsgPatcher.Model
public Dictionary<string, List<ModifyInfo>> FileModifyInfos { get; set; }
/// <summary>
/// 通用的修改特征
/// </summary>
public Dictionary<string, List<ModifyInfo>> FileCommonModifyInfos { get; set; }
public HashSet<string> GetSupportVersions()
{
// 使用 HashSet 防重

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RevokeMsgPatcher.Model
{
public class CommonModifyInfo
{
public string Name { get; set; }
public string StartVersion { get; set; }
public string EndVersion { get; set; }
public List<Change> Changes { get; set; }
public CommonModifyInfo Clone()
{
CommonModifyInfo o = new CommonModifyInfo();
o.Name = Name;
o.StartVersion = StartVersion;
o.EndVersion = EndVersion;
List<Change> cs = new List<Change>();
foreach(Change c in Changes)
{
cs.Add(c.Clone());
}
o.Changes = cs;
return o;
}
}
}

View File

@@ -11,8 +11,6 @@ namespace RevokeMsgPatcher.Model
{
public string Name { get; set; }
//public string RelativePath { get; set; }
public string Version { get; set; }
public string SHA1Before { get; set; }

View File

@@ -60,6 +60,7 @@
<Compile Include="Model\App.cs" />
<Compile Include="Model\Bag.cs" />
<Compile Include="Model\Change.cs" />
<Compile Include="Model\CommonModifyInfo.cs" />
<Compile Include="Model\ModifyInfo.cs" />
<Compile Include="Model\TargetInfo.cs" />
<Compile Include="Modifier\AppModifier.cs" />