added box class

This commit is contained in:
szabomarton
2025-03-14 11:19:14 +01:00
parent 1ebc6c67b6
commit 63a0218e9d
13 changed files with 55 additions and 9 deletions

View File

@@ -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);
}
}
}
}