private static int CompareSchedules(EpisodePointScheduleVO a, EpisodePointScheduleVO b) { if (a == b) { return(0); } if (a.Priority != b.Priority) { return((a.Priority <= b.Priority) ? -1 : 1); } if (a.StartTimeEpochSecs != b.StartTimeEpochSecs) { return((a.StartTimeEpochSecs <= b.StartTimeEpochSecs) ? -1 : 1); } return(0); }
public EpisodePointScaleVO GetCurrentEpisodePointScaleVO() { if (this.CurrentEpisodeData == null) { return(null); } StaticDataController staticDataController = Service.StaticDataController; EpisodePointScaleVO result = staticDataController.Get <EpisodePointScaleVO>(this.CurrentEpisodeData.PointScale); List <EpisodePointScheduleVO> list = new List <EpisodePointScheduleVO>(); foreach (EpisodePointScheduleVO current in staticDataController.GetAll <EpisodePointScheduleVO>()) { EpisodePointScheduleVO episodePointScheduleVO = current; if ((long)episodePointScheduleVO.EndTimeEpochSecs > (long)((ulong)ServerTime.Time)) { if ((long)episodePointScheduleVO.StartTimeEpochSecs <= (long)((ulong)ServerTime.Time)) { list.Add(episodePointScheduleVO); } } } if (list.Count > 0) { List <EpisodePointScheduleVO> arg_C9_0 = list; if (EpisodeController.< > f__mg$cache0 == null) { EpisodeController.< > f__mg$cache0 = new Comparison <EpisodePointScheduleVO>(EpisodeController.CompareSchedules); } arg_C9_0.Sort(EpisodeController.< > f__mg$cache0); EpisodePointScaleVO optional = staticDataController.GetOptional <EpisodePointScaleVO>(list[0].ScaleId); if (optional != null) { return(optional); } } return(result); }