Exemple #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);
     }
 }
Exemple #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++;
            }
        }
Exemple #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];
        }
        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++;
            }
        }
 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);
 }
 public bool Equals(ColorCharPair other)
 {
     return Color == other.Color && Tile == other.Tile;
 }
 public bool Equals(ColorCharPair other)
 {
     return(Color == other.Color && Tile == other.Tile);
 }