Пример #1
0
        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));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }
Пример #6
0
        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);
        }