53
1
using System;
2
using System.Collections.Generic;
3
4
public interface IComponent
5
{
6
void Render();
7
}
8
9
public class Shape: IComponent
10
{
11
public void Render()
12
{
13
Console.WriteLine("Render Shape");
14
}
15
}
16
17
public class Group: IComponent
18
{
19
private List<IComponent> components = new List<IComponent>();
20
21
public void Add(IComponent component)
22
{
23
components.Add(component);
24
}
Cached Result
CAFE at 1 2