public static string GetCityBattleTimeAndBangHuiListString() { string result; if (WangChengManager.WangChengZhanFightingDayTimes == null || WangChengManager.WangChengZhanFightingDayTimes.Length <= 0) { result = ""; } else { int day = TimeUtil.NowDateTime().DayOfYear; BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6); if (null == lingDiItem) { result = ""; } else { Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest); List <DateTime> lsDays = new List <DateTime>(); for (int i = 0; i < warRequestMap.Count; i++) { DateTime dt = TimeUtil.NowDateTime(); int span = warRequestMap.Values.ElementAt(i) - day; if (span >= 0) { dt = dt.AddDays((double)span); } else { int yearNext = dt.Year + 1; dt = DateTime.Parse(string.Format("{0}-01-01", yearNext)).AddDays((double)(warRequestMap.Values.ElementAt(i) - 1)); } lsDays.Add(dt); } lsDays.Sort(delegate(DateTime l, DateTime r) { int result2; if (l.Ticks < r.Ticks) { result2 = -1; } else if (l.Ticks > r.Ticks) { result2 = 1; } else { result2 = 0; } return(result2); }); string timeBangHuiString = ""; int index = 0; while (index < lsDays.Count && index < 10) { int dayID = lsDays[index].DayOfYear; for (int i = 0; i < warRequestMap.Count; i++) { if (dayID == warRequestMap.Values.ElementAt(i)) { int bangHuiID = warRequestMap.Keys.ElementAt(i); string strTime; string strBH; WangChengManager.GetWarTimeStringAndBHName(dayID, bangHuiID, out strTime, out strBH); if (timeBangHuiString.Length > 0) { timeBangHuiString += ","; } timeBangHuiString += string.Format("{0},{1}", strTime, strBH); break; } } index++; } result = timeBangHuiString; } } return(result); }
public static bool GetNextCityBattleTimeAndBangHui(out string dayTime, out string bangHuiName) { dayTime = GLang.GetLang(43, new object[0]); bangHuiName = GLang.GetLang(568, new object[0]); int warDay; int bangHuiID; return(WangChengManager.GetNextCityBattleTimeAndBangHui(out warDay, out bangHuiID) && WangChengManager.GetWarTimeStringAndBHName(warDay, bangHuiID, out dayTime, out bangHuiName)); }