Ejemplo n.º 1
0
 public void DrawAtAbsolutePoint(int x, int y, char c, ConsoleColor color = ConsoleColor.White)
 {
     if (x >= 0 && x < XLength && y >= 0 && y < YLength)
     {
         _newPresent[x, y] = new ColorCharPair(c, color);
     }
 }
Ejemplo n.º 2
0
        public void DrawAtAbsolutePoint(int x, int y, string s, ConsoleColor color = ConsoleColor.White)
        {
            if (s == null)
            {
                return;
            }

            int i = 0;

            for (int newX = x; newX < (x + s.Length > XLength ? XLength : x + s.Length); newX++)
            {
                _newPresent[newX, y] = new ColorCharPair(s[i], color);
                i++;
            }
        }
Ejemplo n.º 3
0
        public void Flush()
        {
            ColorCharPair?[,] toDraw = GetChanges();
            for (int x = 0; x < XLength; x++)
            {
                for (int y = 0; y < YLength; y++)
                {
                    if (!toDraw[x, y].HasValue)
                    {
                        continue;
                    }

                    SetPosition(x, y);
                    ColorCharPair pair = toDraw[x, y].Value;
                    Console.ForegroundColor = pair.Color;
                    Console.Write(pair.Tile);
                }
            }
            SetPosition(0, YLength);
            _oldPresent = (ColorCharPair[, ])_newPresent.Clone();
            _newPresent = new ColorCharPair[XLength, YLength];
        }
Ejemplo n.º 4
0
        public void DrawAtAbsolutePoint(int x, int y, string s, ConsoleColor color = ConsoleColor.White)
        {
            if(s == null)
                return;

            int i = 0;
            for (int newX = x; newX < (x + s.Length > XLength ? XLength : x + s.Length); newX++)
            {
                _newPresent[newX, y] = new ColorCharPair(s[i], color);
                i++;
            }
        }
Ejemplo n.º 5
0
 public void DrawAtAbsolutePoint(int x, int y, char c, ConsoleColor color = ConsoleColor.White)
 {
     if(x >= 0 && x < XLength && y >= 0 && y < YLength)
         _newPresent[x, y] = new ColorCharPair(c, color);
 }
Ejemplo n.º 6
0
 public bool Equals(ColorCharPair other)
 {
     return Color == other.Color && Tile == other.Tile;
 }
Ejemplo n.º 7
0
 public bool Equals(ColorCharPair other)
 {
     return(Color == other.Color && Tile == other.Tile);
 }