示例#1
0
        public CardImage CreateQuestFront(Quest quest)
        {
            var cardImage = new CardImage($"Quest - {quest.Name}", ImageOrientation.Portrait);

            cardImage.PrintCardBorderAndBackground(null, standardCardBackgroundColor);
            var graphics     = cardImage.Graphics;
            var headerFont   = new Font(headerFontFamily, questHeaderFontSize, FontStyle.Bold, GraphicsUnit.Pixel);
            var headerHeight = headerFont.Height;
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;

            GraphicsUtilities.DrawString(
                graphics,
                quest.Name,
                headerFont,
                GraphicsUtilities.BlackBrush,
                new RectangleF(usableRectangleWithPadding.X, usableRectangleWithPadding.Y, usableRectangleWithPadding.Width, headerHeight),
                GraphicsUtilities.HorizontalCenterAlignment);
            var questDescriptionFont   = new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel);
            var questDescriptionHeight = questDescriptionFont.Height * 3;

            GraphicsUtilities.DrawString(
                graphics,
                quest.Description,
                questDescriptionFont,
                GraphicsUtilities.BlackBrush,
                new RectangleF(usableRectangleWithPadding.X, usableRectangleWithPadding.Y + headerHeight, usableRectangleWithPadding.Width, questDescriptionHeight),
                GraphicsUtilities.HorizontalCenterAlignment);
            PrintCostsForQuest(graphics, quest, usableRectangleWithPadding.Left, usableRectangleWithPadding.Top + headerHeight + questDescriptionHeight);
            PrintPoints(graphics, quest.Points, usableRectangleWithPadding.Right - wreathImageWidth, usableRectangleWithPadding.Top + headerHeight + questDescriptionHeight);
            var questImageY = usableRectangleWithPadding.Top + headerHeight + questDescriptionHeight + cardFrontSmallImageSize;

            GraphicsUtilities.PrintScaledJpg(graphics, quest.Image, usableRectangleWithPadding.X, questImageY, usableRectangleWithPadding.Width, usableRectangleWithPadding.Height - (questImageY + questImageYBottomPadding));
            return(cardImage);
        }
示例#2
0
        public CardImage CreateSetupAidFront()
        {
            var cardImage = new CardImage("Setup Aid", ImageOrientation.Portrait);
            var graphics  = cardImage.Graphics;

            cardImage.PrintCardBorderAndBackground(null, standardCardBackgroundColor);

            var setupAidTitle = "Game Setup";
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;
            var titleFont = new Font(headerFontFamily, questHeaderFontSize, FontStyle.Bold, GraphicsUnit.Pixel);

            GraphicsUtilities.DrawString(graphics, setupAidTitle, titleFont, GraphicsUtilities.BlackBrush, usableRectangleWithPadding);

            var textRectangle = new RectangleF(
                usableRectangleWithPadding.X,
                usableRectangleWithPadding.Y + titleFont.Height,
                usableRectangleWithPadding.Width,
                usableRectangleWithPadding.Height - titleFont.Height);
            var textFont = new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel);

            var setupAidString =
                "\r\n\r\nResources:\r\nGold: Always 5\r\n4 Players: 7 of each other resource\r\n3 Players: 5 of each other resource\r\n2 Players: 4 of each other resource" +
                "\r\n\r\n\r\nQuests:\r\n 1 + Player Count" +
                "\r\n\r\n\r\nTools:\r\n4 per Tier";

            GraphicsUtilities.DrawString(graphics, setupAidString, textFont, GraphicsUtilities.BlackBrush, textRectangle);

            return(cardImage);
        }
示例#3
0
        public CardImage CreateQuestAidFront()
        {
            var cardImage = new CardImage("Quest Aid", ImageOrientation.Portrait);
            var graphics  = cardImage.Graphics;

            cardImage.PrintCardBorderAndBackground(null, standardCardBackgroundColor);
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;

            var questAidTitle = "Completing Quests";
            var titleFont     = new Font(headerFontFamily, questHeaderFontSize, FontStyle.Bold, GraphicsUnit.Pixel);

            GraphicsUtilities.DrawString(graphics, questAidTitle, titleFont, GraphicsUtilities.BlackBrush, usableRectangleWithPadding);

            var textRectangle = new RectangleF(
                usableRectangleWithPadding.X,
                usableRectangleWithPadding.Y + titleFont.Height,
                usableRectangleWithPadding.Width,
                usableRectangleWithPadding.Height - titleFont.Height);
            var textFont = new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel);

            var questAidString = "After completing your action each day, check if you have the tools depicted on each quest." +
                                 "\r\n\r\nIf you do, equip your villagers with those tools and they will complete the quest for you. Take the quest card and place in front of you." +
                                 "\r\n\r\nDon't worry, they'll return the tools in the same condition (more or less). " +
                                 "\r\n\r\nYou only have enough villagers to complete one quest each day. If you gain the tool to complete two quests on the same day, one must be completed on the next day (or be stolen by someone else).";

            GraphicsUtilities.DrawString(graphics, questAidString, textFont, GraphicsUtilities.BlackBrush, textRectangle);

            return(cardImage);
        }
示例#4
0
        public static void PrintCardBackString(CardImage cardImage, string text, int textSize)
        {
            var graphics = cardImage.Graphics;
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;

            GraphicsUtilities.DrawString(
                graphics,
                text,
                new Font(cardBackFontFamily, textSize, FontStyle.Bold, GraphicsUnit.Pixel),
                new SolidBrush(Color.Black),
                usableRectangleWithPadding,
                GraphicsUtilities.FullCenterAlignment);
        }
示例#5
0
        private void PrintImageMapping(Graphics graphics, Image image1, string label1, Image image2, string label2, int x, int y, int imageSize)
        {
            var imageMappingFont = new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel);
            var mappingTextWidth = imageSize + 2 * (arrowImageSize + 2 * ArrowPadding);
            var label1Rectangle  = new RectangleF(x - (arrowImageSize + 2 * ArrowPadding), y + imageSize, mappingTextWidth, imageMappingFont.Height);
            var label2Rectangle  = new RectangleF(x + imageSize + 2 * ArrowPadding + arrowImageSize - (arrowImageSize + 2 * ArrowPadding), y + imageSize, mappingTextWidth, imageMappingFont.Height);

            GraphicsUtilities.PrintScaledImage(graphics, image1, x, y, imageSize, imageSize);
            GraphicsUtilities.DrawString(graphics, label1, imageMappingFont, GraphicsUtilities.BlackBrush, label1Rectangle, GraphicsUtilities.HorizontalCenterAlignment);
            GraphicsUtilities.PrintScaledPng(graphics, "arrow", x + imageSize + ArrowPadding, y + (imageSize / 2), arrowImageSize, arrowImageSize);
            GraphicsUtilities.PrintScaledImage(graphics, image2, x + imageSize + ArrowPadding + arrowImageSize + ArrowPadding, y, imageSize, imageSize);
            GraphicsUtilities.DrawString(graphics, label2, imageMappingFont, GraphicsUtilities.BlackBrush, label2Rectangle, GraphicsUtilities.HorizontalCenterAlignment);
        }
示例#6
0
        private void PrintCardName(NewToolCard newCard, CardImage cardImage)
        {
            var graphics = cardImage.Graphics;
            var usableRectangWithPadding = cardImage.UsableRectangWithPadding;

            var cardNameFont    = new Font(headerFontFamily, toolHeaderFontSize, GraphicsUnit.Pixel);
            var topRectangle    = new RectangleF(usableRectangWithPadding.X, usableRectangWithPadding.Y + cardFrontSmallImageSize, usableRectangWithPadding.Width, cardNameFont.Height);
            var bottomRectangle = new RectangleF(usableRectangWithPadding.X, usableRectangWithPadding.Y + cardFrontSmallImageSize + cardNameFont.Height, usableRectangWithPadding.Width, cardNameFont.Height);
            var nameParts       = newCard.Name.Split(' ');
            var firstNamePart   = nameParts.Take(nameParts.Length - 2).ToList();
            var lastNamePart    = nameParts.Skip(firstNamePart.Count).ToList();

            GraphicsUtilities.DrawString(graphics, string.Join(" ", firstNamePart), cardNameFont, GraphicsUtilities.BlackBrush, topRectangle, GraphicsUtilities.FullCenterAlignment);
            GraphicsUtilities.DrawString(graphics, string.Join(" ", lastNamePart), cardNameFont, GraphicsUtilities.BlackBrush, bottomRectangle, GraphicsUtilities.FullCenterAlignment);
        }
示例#7
0
        private void PrintLimitsReminder(CardImage cardImage)
        {
            var graphics = cardImage.Graphics;
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;
            var handLimitString            = "Hand limit - 3";
            var resourceLimitString        = "Resource limit - 10";
            var limitsReminderFont         = new Font(bodyFontFamily, limitsFontSize, GraphicsUnit.Pixel);
            var textRectangle = new RectangleF(
                usableRectangleWithPadding.X,
                usableRectangleWithPadding.Bottom - limitsReminderFont.Height,
                usableRectangleWithPadding.Width,
                limitsReminderFont.Height);

            GraphicsUtilities.DrawString(graphics, handLimitString, limitsReminderFont, GraphicsUtilities.BlackBrush, textRectangle, GraphicsUtilities.HorizontalNearAlignment);
            GraphicsUtilities.DrawString(graphics, resourceLimitString, limitsReminderFont, GraphicsUtilities.BlackBrush, textRectangle, GraphicsUtilities.HorizontalFarAlignment);
        }
示例#8
0
        private void PrintGameTitle(CardImage cardImage)
        {
            var graphics = cardImage.Graphics;
            var usableRectangleWithPadding = cardImage.UsableRectangWithPadding;
            var titleFont = new Font(cardBackFontFamily, gameTitleFontSize, GraphicsUnit.Pixel);

            GraphicsUtilities.DrawString(
                graphics,
                "Splendor",
                titleFont,
                GraphicsUtilities.BlackBrush,
                new RectangleF(usableRectangleWithPadding.X, usableRectangleWithPadding.Y, usableRectangleWithPadding.Width, titleFont.Height),
                GraphicsUtilities.HorizontalCenterAlignment);
            GraphicsUtilities.DrawString(
                graphics,
                "Forge",
                titleFont,
                GraphicsUtilities.BlackBrush,
                new RectangleF(usableRectangleWithPadding.X, usableRectangleWithPadding.Bottom - titleFont.Height, usableRectangleWithPadding.Width, titleFont.Height),
                GraphicsUtilities.HorizontalCenterAlignment);
        }
示例#9
0
        public CardImage CreatePlayerAidFront()
        {
            var cardImage = new CardImage("Player Aid Front", ImageOrientation.Landscape);
            var graphics  = cardImage.Graphics;

            cardImage.PrintCardBorderAndBackground(null, standardCardBackgroundColor);
            var playerAidString = "Each day, you may take one of the following actions:" +
                                  "\r\n\u2022  Scavenge for Resources: gather 3 different resources" +
                                  "\r\n\u2022  Hunt for Resources: gather 2 of the same resource [as long as there is an abundance (4+)]" +
                                  "\r\n\u2022  Find Blueprint: Reserve a Tool from the display into your hand and take 1 gold [if available]" +
                                  "\r\n\u2022  Craft: Take a Tool from the display, place in front of you and return the depicted resources to the supply" +
                                  "\r\n\r\nAfter your action, check if you have the tools to complete any quests.";

            GraphicsUtilities.DrawString(
                graphics,
                playerAidString,
                new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel),
                GraphicsUtilities.BlackBrush,
                cardImage.UsableRectangWithPadding);
            PrintLimitsReminder(cardImage);
            return(cardImage);
        }