using System.Collections.Generic; namespace ET { public class GalleryRankByCreateTimeComponent : Entity, IAwake, IDestroy { public Dictionary RankInfoDIc = new Dictionary(); public SortedList RankList = new SortedList(new GalleryRankByCreateTimeCompare()); } public class GalleryRankByCreateTimeCompare : IComparer { public int Compare(GalleryRankInfoByCreateTime a, GalleryRankInfoByCreateTime b) { if (a.IsDisposed || b.IsDisposed) { return 0; } int result = (int)(b.CreateTime - a.CreateTime); if (result != 0) { return result; } if (b.Id > a.Id) { return 1; } if (b.Id < a.Id) { return -1; } return 0; } } }