Пример #1
0
        static ConsoleColor getColor(cttt type, bool isLegend)
        {
            ConsoleColor clr = ConsoleColor.DarkGray;

            switch (type)
            {
            case cttt.all:
                clr = (isLegend) ? ConsoleColor.Yellow : ConsoleColor.DarkYellow;
                break;

            case cttt.vit:
                clr = (isLegend) ? ConsoleColor.Green : ConsoleColor.DarkGreen;
                break;

            case cttt.cmb:
                clr = (isLegend) ? ConsoleColor.Red : ConsoleColor.DarkRed;
                break;

            case cttt.inl:
                clr = (isLegend) ? ConsoleColor.Cyan : ConsoleColor.DarkCyan;
                break;

            case cttt.src:
                clr = (isLegend) ? ConsoleColor.Blue : ConsoleColor.DarkBlue;
                break;

            default:
                break;
            }
            return(clr);
        }
Пример #2
0
        static void traceCard(cttt type, bool isLegend, string TYP, string name, string descr)
        {
            int wid     = 40;
            int toppart = 20;
            int hei     = 30;

            ConsoleColor clr = getColor(type, isLegend);

            string SS = "";

            for (int i = 0; i < wid - 6; ++i)
            {
                SS += (i % 2 == 0) ? '▄' : '▀';
            }
            Console.ForegroundColor = (clr);

            Console.WriteLine("┼".PadRight(wid - 1, '▓') + "┼");
            Console.WriteLine("▓┌".PadRight(wid - 2, '─') + "┐▓");
            Console.WriteLine("▓│╔".PadRight(wid - 3, '═') + "╗│▓");
            Console.WriteLine("▓│║" + SS + "║│▓");
            for (int i = 0; i < toppart - 1; ++i)
            {
                Console.WriteLine("▓│║".PadRight(wid - 3, ' ') + "║│▓");
            }

            Console.WriteLine("▓│╟".PadRight(wid - 3, '─') + "╢│▓");

            Console.WriteLine("▓│║" + SS + "║│▓");
            for (int i = 0; i < hei - toppart; ++i)
            {
                Console.WriteLine("▓│║".PadRight(wid - 3, ' ') + "║│▓");
            }

            Console.WriteLine("▓│╚".PadRight(wid - 3, '═') + "╝│▓");
            Console.WriteLine("▓└".PadRight(wid - 2, '─') + "┘▓");
            Console.WriteLine("┼".PadRight(wid - 1, '▓') + "┼");



            Console.SetCursorPosition(wid / 2 - TYP.Length / 2 - 2, 3);
            Console.Write("█[" + TYP + "]█");

            ConsoleColor cl = Console.ForegroundColor;

            Console.ResetColor();
            Console.SetCursorPosition(wid / 2 - name.Length / 2 - 2, 1);
            Console.Write("┤ " + name + " ├");
            Console.SetCursorPosition(wid / 2 - name.Length / 2 - 2, 0);
            Console.Write("╒".PadRight(name.Length + 3, '═') + "╕");
            Console.SetCursorPosition(wid / 2 - name.Length / 2 - 2, 2);
            Console.Write("╧".PadRight(name.Length + 3, '═') + "╧");


            writeSomething(descr, 4, toppart + 4, wid - 9, hei - toppart, TYP.IndexOf("персонаж") < 0, cl);
            Console.SetCursorPosition(0, hei + 9);
        }