Esempio n. 1
0
        private void DrawCircle(int col, int row, GetConsoleColor getConsoleColor, GetChar getChar)
        {
            var angle           = 0;
            var backgroundColor = getConsoleColor();

            while (angle <= 45)
            {
                var left = Math.Min(this.Width, Math.Max(0, col + (int)(Math.Cos(angle) * this.radius)));
                var top  = Math.Min(this.Height, Math.Max(0, row + (int)(Math.Sin(angle) * this.radius)));

                lock (this.LockObj)
                {
                    Console.CursorLeft      = left;
                    Console.CursorTop       = top;
                    Console.ForegroundColor = getConsoleColor();
                    Console.BackgroundColor = backgroundColor;
                    Console.Write(getChar());
                }

                angle++;
                Thread.Sleep(this.SleepTime);
            }
        }
        private void DrawCircle(int col, int row, GetConsoleColor getConsoleColor, GetChar getChar)
        {
            var angle = 0;
            var backgroundColor = getConsoleColor();

            while (angle <= 45)
            {
                var left = Math.Min(this.Width, Math.Max(0, col + (int)(Math.Cos(angle) * this.radius)));
                var top = Math.Min(this.Height, Math.Max(0, row + (int)(Math.Sin(angle) * this.radius)));

                lock (this.LockObj)
                {
                    Console.CursorLeft = left;
                    Console.CursorTop = top;
                    Console.ForegroundColor = getConsoleColor();
                    Console.BackgroundColor = backgroundColor;
                    Console.Write(getChar());
                }

                angle++;
                Thread.Sleep(this.SleepTime);
            }
        }