Example #1
0
 public static void DrawBorder(Point _Start, Point _End,
                               ConsoleColor _BorderColor = ConsoleColor.White, bool _DrawDownRightSymbol = true)
 {
     for (int x = _Start.X; x <= _End.X; x++)
     {
         for (int y = _Start.Y; y <= _End.Y; y++)
         {
             if (y == _Start.Y)
             {
                 if (x == _Start.X)
                 {
                     BackBuffer[x, y] = new Glyph('╔', _BorderColor, ConsoleColor.Black);
                 }
                 else if (x == _End.X)
                 {
                     BackBuffer[x, y] = new Glyph('╗', _BorderColor, ConsoleColor.Black);
                 }
                 else
                 {
                     BackBuffer[x, y] = new Glyph('═', _BorderColor, ConsoleColor.Black);
                 }
             }
             else if (y == _End.Y)
             {
                 if (_DrawDownRightSymbol)
                 {
                     if (x == _Start.X)
                     {
                         BackBuffer[x, y] = new Glyph('╚', _BorderColor, ConsoleColor.Black);
                     }
                     else if (x == _End.X)
                     {
                         BackBuffer[x, y] = new Glyph('╝', _BorderColor, ConsoleColor.Black);
                     }
                     else
                     {
                         BackBuffer[x, y] = new Glyph('═', _BorderColor, ConsoleColor.Black);
                     }
                 }
                 else
                 {
                     if (x == _Start.X)
                     {
                         BackBuffer[x, y] = new Glyph('╚', _BorderColor, ConsoleColor.Black);
                     }
                     else if (x != _End.X)
                     {
                         BackBuffer[x, y] = new Glyph('═', _BorderColor, ConsoleColor.Black);
                     }
                 }
             }
             else
             {
                 if (x == _Start.X || x == _End.X)
                 {
                     BackBuffer[x, y] = new Glyph('║', _BorderColor, ConsoleColor.Black);
                 }
             }
         }
     }
 }
Example #2
0
 public static void Write(Point _Position, Glyph _Glyph)
 {
     BackBuffer[_Position.X, _Position.Y] = _Glyph;
 }