コード例 #1
0
        private void DrawFigure(IDrawableFigure drawableFigure)
        {
            if (drawableFigure == null)
            {
                return;
            }

            Console.WriteLine($"Figure: {drawableFigure.GetType().Name}  Color: {drawableFigure.Color}  X:{drawableFigure.X}  Y:{drawableFigure.Y}");
            Console.WriteLine();
        }
コード例 #2
0
        private void DrawFigure(IDrawableFigure drawableFigure)
        {
            if (drawableFigure == null)
            {
                return;
            }

            var currentColor = Console.ForegroundColor;

            Console.ForegroundColor = drawableFigure.Color;

            Console.WriteLine("Figure: " + drawableFigure.GetType().Name);
            Console.WriteLine("Color: " + drawableFigure.Color);
            Console.WriteLine("X: " + drawableFigure.CoordinateX);
            Console.WriteLine("Y: " + drawableFigure.CoordinateY);
            Console.WriteLine();

            Console.ForegroundColor = currentColor;
        }