using System; using System.Collections.Generic; namespace hirdParty.DownloadSystem { [Serializable] public class AssetMD5Info { public List fileInfo; public void Deduplication() { if (fileInfo == null) { return; } List allName = new List(); for (int i = 0; i < fileInfo.Count; i++) { string n = fileInfo[i].fileName; if (allName.Contains(n)) { fileInfo.RemoveAt(i); i--; } allName.Add(n); } } public void Sort() { if (fileInfo == null) { return; } fileInfo.Sort(Stot); } private int Stot(MD5FileInfo a, MD5FileInfo b) { if (a.size > b.size) { return 1; } else if (a.size < b.size) { return -1; } return 0; } public AssetMD5Info(List a) { this.fileInfo = a; } } [Serializable] public class MD5FileInfo { public string fileName; public string md5; public long size; } }