mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
C# animal
This commit is contained in:
18
03 Animal/csharp/Branch.cs
Normal file
18
03 Animal/csharp/Branch.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Animal
|
||||
{
|
||||
public class Branch
|
||||
{
|
||||
public string Text { get; set; }
|
||||
|
||||
public bool IsEnd => Yes == null && No == null;
|
||||
|
||||
public Branch Yes { get; set; }
|
||||
|
||||
public Branch No { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Text} : IsEnd {IsEnd}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user