public class ComponentGroup{
public ComponentGroup(){
objects = new Component[10];
objectCount = 0;
}
public void AddObject(Component obj)
{
if (objectCount < 10)
{
objects[objectCount] = obj;
objectCount++;
}
}
public void Render(){
for (int i = 0; i < objectCount; i++)
{
objects[i].Render();
}
}
Component[] objects;
int objectCount;
}
public class Component
{
internal void Render() {}
}
class Test
{
public static void Main()
{
ComponentGroup group = new ComponentGroup();
group.AddObject(new Component());
}
}