Пример #1
0
        /// <summary>
        /// Returns a combination of GetHash and CenterPadHash to create a box
        /// </summary>
        /// <param name="text">String to center-align</param>
        /// <param name="length">Final width of box</param>
        /// <returns></returns>
        public static string CenterBoxHashReturn(string text, int length)
        {
            var finalString = PrintUtils.GetHashReturn(length);

            finalString += PrintUtils.CenterPadHashReturn(text, length);
            finalString += PrintUtils.GetHashReturn(length);
            return(finalString);
        }
Пример #2
0
        public static void ShopScreen()
        {
            PrintUtils.GetHash(103, ConsoleColor.Cyan);
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Write(PrintUtils.CenterPadHashReturn("SHOP", 103));
            Console.WriteLine($@"
#                            #        ████████████████       #       ██████████████████████████       #
#      ██████    ██████      #      ██              ▒▒██     #     ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██              ▒▒██     #     ██▒▒                      ▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██    ▒▒▒▒▒▒▒▒  ▒▒██     #     ██▒▒                      ▒▒██     #
#    ██  ▒▒██    ██  ▒▒██    #      ██  ▒▒▒▒████▒▒  ▒▒██     #     ██▒▒                      ▒▒██     #
#  ██    ▒▒██    ██      ██  #      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#██    ▒▒▒▒██    ██▒▒    ▒▒██#      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#██▒▒▒▒▒▒██        ██▒▒▒▒▒▒██#      ██  ▒▒██    ██  ▒▒██     #     ██▒▒                      ▒▒██     #
#████████            ████████#      ██▒▒▒▒██    ██▒▒▒▒██     #     ██▒▒                      ▒▒██     #
#                            #      ████████    ████████     #     ██▒▒          ██          ▒▒██     #
#   [1]Boots        ₴ 10     #  [2]Leggings     ₴ 20         #     ██▒▒        ██████        ▒▒██     #
##############################################################     ██▒▒          ██          ▒▒██     #
#                            #       ████        ████        #     ██▒▒                      ▒▒██     #
#                            #   ████  ▒▒██    ██    ████    #     ██▒▒                      ▒▒██     #
#       ████████████         # ██      ▒▒██    ██      ▒▒██  #     ██▒▒                      ▒▒██     #
#     ██          ▒▒██       # ██          ████        ▒▒██  #     ██▒▒                      ▒▒██     #
#   ██            ▒▒▒▒██     # ██▒▒                  ▒▒▒▒██  #     ██▒▒                      ▒▒██     #
#   ██          ▒▒▒▒▒▒██     #   ██                ▒▒▒▒██    #       ██▒▒                  ▒▒██       #
#   ██    ████████▒▒▒▒██     #   ██▒▒              ▒▒▒▒██    #         ██▒▒              ▒▒██         #
#   ██  ████████████▒▒██     #     ██              ▒▒██      #           ██▒▒          ▒▒██           #
#   ██  ████████████▒▒██     #     ██            ▒▒▒▒██      #             ██▒▒▒▒▒▒▒▒▒▒██             #
#     ████        ████       #     ██▒▒        ▒▒▒▒▒▒██      #               ██▒▒▒▒▒▒██               #
#                            #     ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██      #                 ██▒▒██                 #
#                            #       ██▒▒▒▒▒▒▒▒▒▒▒▒██        #                   ██                   #
#                            #         ████████████          #                                        #
#                            #                               #                                        #
#    [3]Helmet      ₴ 30     #      [4]Chestplate ₴ 40       #     [5]Shield     ₴ 35                 #");
            PrintUtils.GetHash(103);
            PrintUtils.CenterPadHash("Type the number of the you want to buy to purchase. Type back to go back.", 103);
            PrintUtils.CenterPadHash($"You have ₴{MainGame.player.money.ToString()}.", 103);
            PrintUtils.GetHash(103);
            bool inLoop = true;

            while (inLoop)
            {
                string cart = PrintUtils.Input().ToLower();
                switch (cart)
                {
                case "1":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("boots"));
                    break;

                case "2":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("leggings"));
                    break;

                case "3":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("helmet"));
                    break;

                case "4":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("chestplate"));
                    break;

                case "5":
                    inLoop = false;
                    MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("shield"));
                    break;

                case "back":
                    inLoop = false;
                    MainGame.Prompt();
                    break;

                default:
                    Console.WriteLine("Please enter a valid number.");
                    break;
                }
            }
        }