[+] 通用特征替换的数据结构与查找方法
This commit is contained in:
@@ -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 防重
|
||||
|
||||
35
RevokeMsgPatcher/Model/CommonModifyInfo.cs
Normal file
35
RevokeMsgPatcher/Model/CommonModifyInfo.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user