Added ToString implementation

This commit is contained in:
MarcUs7i 2024-12-16 19:43:48 +01:00
parent 1c5a634afb
commit 245ba9b6a6

View file

@ -59,7 +59,15 @@ public sealed class Chain
/// <returns>String representation of the bucket chain</returns>
public override string ToString()
{
// TODO
return string.Empty;
string result = $"{_well} | ";
Person? currentPerson = _firstPerson;
for (int i = 0; i < _requiredPeople; i++)
{
result += $"{currentPerson?.ToString() ?? "\u2754"} | ";
currentPerson = currentPerson?.RightNeighbor;
}
result += $"{_fire}";
return result;
}
}