-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (31 loc) · 906 Bytes
/
Program.cs
File metadata and controls
39 lines (31 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace bridge
{
class Consumer
{
public void Render(Shape shape)
{
Console.WriteLine(shape.Draw());
Console.WriteLine();
}
}
class Program
{
static void Main(string[] args)
{
Consumer client = new();
Shape redCircle = new Circle(new Red());
client.Render(redCircle);
Shape redSquare = new Square(new Red());
client.Render(redSquare);
Shape blueCircle = new Circle(new Blue());
client.Render(blueCircle);
Shape blueSquare = new Square(new Blue());
client.Render(blueSquare);
Shape greenCircle = new Circle(new Green());
client.Render(greenCircle);
Shape greenSquare = new Square(new Green());
client.Render(greenSquare);
}
}
}