Пример #1
0
        void DrawActivatedElements(Graphics graphics, ElementCounts elements, ElementLayout elLayout, int skip = 0)
        {
            var orderedElements = elements.Keys.OrderBy(el => (int)el);
            int idx             = skip;

            foreach (var element in orderedElements)
            {
                var rect = elLayout.Rect(idx++);
                graphics.DrawImage(GetElementImage(element), rect);
                graphics.DrawCountIfHigherThan(rect, elements[element]);
            }
        }
Пример #2
0
        public SpiritLayout(Graphics graphics, Spirit spirit, Rectangle bounds, int margin)
        {
            var rects = bounds.InflateBy(-margin).SplitVerticallyByWeight(margin, 200f, 360f, 420f, 60f);

            Calc_GrowthRow(spirit, rects[0], margin);
            trackLayout = new PresenceTrackLayout(rects[1], spirit, margin);
            int height = Calc_Innates(spirit, graphics, rects[2], margin);

            // If Innates are too tall, shrink them down.
            if (height > rects[2].Height)
            {
                var r          = rects[2];
                var scaledRect = new Rectangle(r.X, r.Y, r.Width * r.Height / height, r.Height);
                Calc_Innates(spirit, graphics, scaledRect, margin);
            }
            Elements = new ElementLayout(rects[3]);
        }