mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Add printing of bugs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Text;
|
||||
using BugGame.Resources;
|
||||
|
||||
namespace BugGame.Parts;
|
||||
@@ -24,4 +25,17 @@ internal class Body : ParentPart
|
||||
Leg => _legs.TryAddOne(out message),
|
||||
_ => throw new NotSupportedException($"Can't add a {part.Name} to a {Name}.")
|
||||
};
|
||||
|
||||
public void AppendTo(StringBuilder builder, char feelerCharacter)
|
||||
{
|
||||
_neck.AppendTo(builder, feelerCharacter);
|
||||
builder
|
||||
.AppendLine(" BBBBBBBBBBBB")
|
||||
.AppendLine(" B B")
|
||||
.AppendLine(" B B");
|
||||
_tail.AppendTo(builder);
|
||||
builder
|
||||
.AppendLine(" BBBBBBBBBBBB");
|
||||
_legs.AppendTo(builder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user