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