public Circle(int x, int y, int r, ColorSVG color) { this.x = x; this.y = y; this.r = r; this.color = color; }
public Line(int x1, int y1, int x2, int y2, ColorSVG color) { this.x1 = x1; this.x2 = x2; this.y1 = y1; this.y2 = y2; this.color = color; }
private void AddCircle() { Console.WriteLine("Podaj współrzędną x1 koła."); int x = int.Parse(Console.ReadLine()); Console.WriteLine("Podaj współrzędną y1 koła."); int y = int.Parse(Console.ReadLine()); Console.WriteLine("Podaj promień koła."); int r = int.Parse(Console.ReadLine()); ColorSVG color = GetColor(); img.AddElement(new Circle(x, y, r, color)); }
private void AddLine() { Console.WriteLine("Podaj współrzędną x1 linii."); int x1 = int.Parse(Console.ReadLine()); Console.WriteLine("Podaj współrzędną y1 linii."); int y1 = int.Parse(Console.ReadLine()); Console.WriteLine("Podaj współrzędną x2 linii."); int x2 = int.Parse(Console.ReadLine()); Console.WriteLine("Podaj współrzędną y2 linii."); int y2 = int.Parse(Console.ReadLine()); ColorSVG color = GetColor(); img.AddElement(new Line(x1, y1, x2, y2, color)); }