using Cal.DataTable; using System; using System.Collections.Generic; namespace ET { public class OnlineRewardComponentAwakeSystem : AwakeSystem { public override void Awake(OnlineRewardComponent self) { self.Awake(); } } public static class OnlineRewardComponentSystem { public static void Awake(this OnlineRewardComponent self) { OnlineRewardComponent.instance = self; IEnumerable list = DataTableHelper.GetAll(); foreach (OnlineRewardBase item in list) { self.timeList.Add((int)item.Id); } self.timeList.Sort(); } public static int GetRewardTime(this OnlineRewardComponent self,TimeSpan onlineTime) { for (int i = self.timeList.Count - 1; i >= 0; i--) { int time = self.timeList[i]; if (time <= onlineTime.TotalMinutes) return time; } return 0; } } }