Пример #1
0
 public PcmColor(PcmColor color, float alpha)
 {
     R = color.R;
     B = color.B;
     G = color.G;
     A = Convert.ToByte(alpha);
 }
Пример #2
0
        private static void PrintRow(int width, PcmColor color, PcmColor backgroundColor, GameConsoles targetConsole = GameConsoles.Output, params string[] columns)
        {
            var columnWidth = (width - columns.Length) / columns.Length;
            var row         = "|";

            foreach (var column in columns)
            {
                row += AlignCenter(column, columnWidth) + "|";
            }

            WriteLine(row, color, backgroundColor, targetConsole);
        }
Пример #3
0
        public static void Write(string text, PcmColor color = null, PcmColor backgroundColor = null, GameConsoles targetConsole = GameConsoles.Output)
        {
            ConsoleBuffer consoleBuffer;

            switch (targetConsole)
            {
            case GameConsoles.Events:
                consoleBuffer = potatoChipGame.Events;
                break;

            default:
                consoleBuffer = potatoChipGame.Output;
                break;
            }
            foreach (var c in text)
            {
                consoleBuffer.Write(new ConsoleChar(c, color ?? PcmColor.White, backgroundColor ?? PcmColor.Black));
            }
        }
Пример #4
0
 public TableOutput(int width, PcmColor foregroundColor = null, PcmColor backgroundColor = null)
 {
     this.width      = width;
     ForegroundColor = foregroundColor ?? PcmColor.Cyan;
     BackgroundColor = backgroundColor ?? PcmColor.Black;
 }
Пример #5
0
 private static void PrintLine(int width, PcmColor color, PcmColor backgroundColor, GameConsoles targetConsole = GameConsoles.Output)
 {
     WriteLine(new string('-', width), color, backgroundColor, targetConsole);
 }
Пример #6
0
 public ConsoleChar(char character, PcmColor foregroundColor = null, PcmColor backgroundColor = null)
 {
     Char            = character;
     ForegroundColor = foregroundColor ?? PcmColor.White;
     BackgroundColor = backgroundColor ?? PcmColor.Black;
 }