| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections.Generic;
- namespace ET
- {
- public class GalleryRankInfosComponent : Entity, IAwake, IDestroy
- {
- public SortedList<GalleryRankInfo, long> RankList = new SortedList<GalleryRankInfo, long>(new GalleryRankCompare());
- public Dictionary<long, GalleryRankInfo> RankInfoDIc = new Dictionary<long, GalleryRankInfo>();
- }
- public class GalleryRankCompare : IComparer<GalleryRankInfo>
- {
- public int Compare(GalleryRankInfo a, GalleryRankInfo b)
- {
- if(a.IsDisposed || b.IsDisposed)
- {
- return 0;
- }
- int result = (int)(b.BelikedCount - a.BelikedCount);
- if(result != 0)
- {
- return result;
- }
- if(b.BeLikedTime < a.BeLikedTime)
- {
- return 1;
- }
- if (b.BeLikedTime > a.BeLikedTime)
- {
- return -1;
- }
- if (b.Id < a.Id)
- {
- return 1;
- }
- if (b.Id > a.Id)
- {
- return -1;
- }
- return 0;
- }
- }
- }
|