added box class
This commit is contained in:
@@ -17,7 +17,38 @@ namespace Program
|
||||
|
||||
foreach (var item in AllBoxes)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
Doboz doboz = new Doboz(item);
|
||||
foreach (var box in Boxes)
|
||||
{
|
||||
if (doboz.Type == 'A')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (box.Type == 'A' && box.Children == null)
|
||||
{
|
||||
if (doboz.Type == 'B' || doboz.Type == 'C')
|
||||
{
|
||||
box.AddChildren(doboz);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (box.Type == 'B' && box.Children == null)
|
||||
{
|
||||
if (doboz.Type == 'C')
|
||||
{
|
||||
box.AddChildren(doboz);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Boxes.Add(doboz);
|
||||
}
|
||||
|
||||
foreach (var item in Boxes)
|
||||
{
|
||||
item.PrintBoxContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user