Store in GIT
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pannenkoekenhuis.Composite
|
||||
{
|
||||
public class Menu : MenuComponent
|
||||
{
|
||||
string naam;
|
||||
List<MenuComponent> components;
|
||||
|
||||
public Menu(string naam)
|
||||
{
|
||||
this.naam = naam;
|
||||
components = new List<MenuComponent>();
|
||||
}
|
||||
|
||||
public override string DrukAf()
|
||||
{
|
||||
string str = naam + "\n";
|
||||
foreach(MenuComponent m in components)
|
||||
{
|
||||
str += "\t" + m.DrukAf() + "\n";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public override void VoegToe(MenuComponent m)
|
||||
{
|
||||
components.Add(m);
|
||||
}
|
||||
|
||||
public override void Verwijder(MenuComponent m)
|
||||
{
|
||||
components.Remove(m);
|
||||
}
|
||||
|
||||
public string Naam()
|
||||
{
|
||||
return naam;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user