private static string SeasonsContinuousRangeLabel(List <Twelfth> twelfths, Twelfth rootTwelfth, Vector2 longLat) { Twelfth leftMostTwelfth = TwelfthUtility.GetLeftMostTwelfth(twelfths, rootTwelfth); Twelfth rightMostTwelfth = TwelfthUtility.GetRightMostTwelfth(twelfths, rootTwelfth); for (Twelfth twelfth = leftMostTwelfth; twelfth != rightMostTwelfth; twelfth = TwelfthUtility.TwelfthAfter(twelfth)) { if (!twelfths.Contains(twelfth)) { Log.Error(string.Concat(new object[] { "Twelfths doesn't contain ", twelfth, " (", leftMostTwelfth, "..", rightMostTwelfth, ")" }), false); break; } twelfths.Remove(twelfth); } twelfths.Remove(rightMostTwelfth); return(GenDate.SeasonDateStringAt(leftMostTwelfth, longLat) + " - " + GenDate.SeasonDateStringAt(rightMostTwelfth, longLat)); }
public static Twelfth GetLeftMostTwelfth(List <Twelfth> twelfths, Twelfth rootTwelfth) { if (twelfths.Count >= 12) { return(Twelfth.Undefined); } Twelfth result; do { result = rootTwelfth; rootTwelfth = TwelfthUtility.TwelfthBefore(rootTwelfth); }while (twelfths.Contains(rootTwelfth)); return(result); }
public static Twelfth GetRightMostTwelfth(List <Twelfth> twelfths, Twelfth rootTwelfth) { if (twelfths.Count >= 12) { return(Twelfth.Undefined); } Twelfth m; do { m = rootTwelfth; rootTwelfth = TwelfthUtility.TwelfthAfter(rootTwelfth); }while (twelfths.Contains(rootTwelfth)); return(TwelfthUtility.TwelfthAfter(m)); }
private static string QuadrumsContinuousRangeLabel(List <Twelfth> twelfths, Twelfth rootTwelfth) { Twelfth leftMostTwelfth = TwelfthUtility.GetLeftMostTwelfth(twelfths, rootTwelfth); Twelfth rightMostTwelfth = TwelfthUtility.GetRightMostTwelfth(twelfths, rootTwelfth); for (Twelfth twelfth = leftMostTwelfth; twelfth != rightMostTwelfth; twelfth = TwelfthUtility.TwelfthAfter(twelfth)) { if (!twelfths.Contains(twelfth)) { Log.Error("Twelfths doesn't contain " + twelfth + " (" + leftMostTwelfth + ".." + rightMostTwelfth + ")"); break; } twelfths.Remove(twelfth); } twelfths.Remove(rightMostTwelfth); return(GenDate.QuadrumDateStringAt(leftMostTwelfth) + " - " + GenDate.QuadrumDateStringAt(rightMostTwelfth)); }
private static string SeasonsContinuousRangeLabel(List <Twelfth> twelfths, Twelfth rootTwelfth, Vector2 longLat) { Twelfth leftMostTwelfth = TwelfthUtility.GetLeftMostTwelfth(twelfths, rootTwelfth); Twelfth rightMostTwelfth = TwelfthUtility.GetRightMostTwelfth(twelfths, rootTwelfth); Twelfth twelfth = leftMostTwelfth; while (twelfth != rightMostTwelfth) { if (twelfths.Contains(twelfth)) { twelfths.Remove(twelfth); twelfth = TwelfthUtility.TwelfthAfter(twelfth); continue; } Log.Error("Twelfths doesn't contain " + twelfth + " (" + leftMostTwelfth + ".." + rightMostTwelfth + ")"); break; } twelfths.Remove(rightMostTwelfth); return(GenDate.SeasonDateStringAt(leftMostTwelfth, longLat) + " - " + GenDate.SeasonDateStringAt(rightMostTwelfth, longLat)); }
public static Twelfth GetRightMostTwelfth(List <Twelfth> twelfths, Twelfth rootTwelfth) { Twelfth result; if (twelfths.Count >= 12) { result = Twelfth.Undefined; } else { Twelfth m; do { m = rootTwelfth; rootTwelfth = TwelfthUtility.TwelfthAfter(rootTwelfth); }while (twelfths.Contains(rootTwelfth)); result = TwelfthUtility.TwelfthAfter(m); } return(result); }