Ejemplo n.º 1
0
    /// <summary>
    /// Checks all elements that are available to spirit.
    /// </summary>
    public virtual bool CouldHaveElements(ElementCounts subset)
    {
        // For normal spirits without Prepared Elements, this is only the normal Elements
        int wildCount = Elements[Element.Any];

        return(wildCount == 0 ? Elements.Contains(subset)              // no 'wild-card' elements, Elements must contain subset
                        : subset.Except(Elements).Count <= wildCount); // Find missing elements and count if they are less than our 'wild-card' elements
    }
Ejemplo n.º 2
0
        public void DrawFromLayout(Graphics graphics, CachedImageDrawer imageDrawer, ElementCounts activatedElements,
                                   InnatePower[] innateOptions, IDrawableInnateOption[] innateGroupOptions
                                   )
        {
            if (backgroundCache == null)
            {
                this.imageDrawer   = imageDrawer;
                using var boldFont = layout.BuildBoldFont();
                DrawBackgroundImage(boldFont);
                InitOverlayCache(boldFont);
            }

            // Background Layer
            graphics.DrawImage(backgroundCache, layout.Bounds);

            this.graphics = graphics;
            // Middle Layer - Available
            foreach (WrappingText_InnateOptions wrappintText in layout.Options)
            {
                if (activatedElements.Contains(wrappintText.GroupOption.Elements))
                {
                    graphics.FillRectangle(Brushes.PeachPuff, wrappintText.Bounds);
                }
            }

            // Overlay text / images
            graphics.DrawImage(overlayCache, layout.Bounds);

            // Selected Innate Power
            if (innateOptions.Contains(power))
            {
                using Pen highlightPen = new(Color.Red, 2f);
                graphics.DrawRectangle(highlightPen, layout.Bounds);
            }
            // Selected Innat Option Group
            foreach (var x in layout.Options)
            {
                if (innateGroupOptions.Contains(x.GroupOption))
                {
                    using Pen highlightPen = new(Color.Red, 2f);
                    graphics.DrawRectangle(highlightPen, x.Bounds);
                }
            }
        }