added box class
This commit is contained in:
@@ -8,13 +8,13 @@ namespace Program
|
||||
{
|
||||
internal class Doboz
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public char Type { get; set; }
|
||||
|
||||
public Doboz Children = null;
|
||||
|
||||
public Doboz Parent = null;
|
||||
|
||||
public Doboz(string Type) {
|
||||
public Doboz(char Type) {
|
||||
this.Type = Type;
|
||||
}
|
||||
|
||||
@@ -23,5 +23,20 @@ namespace Program
|
||||
doboz.Parent = this;
|
||||
this.Children = doboz;
|
||||
}
|
||||
|
||||
public void PrintBoxContent(int indent = 0)
|
||||
{
|
||||
string indentStr = "";
|
||||
for (int i = 0; i < indent; i++)
|
||||
{
|
||||
indentStr += "->";
|
||||
}
|
||||
|
||||
Console.WriteLine($"{indentStr}{this.Type}");
|
||||
if (this.Children != null)
|
||||
{
|
||||
this.Children.PrintBoxContent(indent + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user