예제 #1
0
 public string GetFormattedString()
 {
     if (IsLeaf)
     {
         return(new string(' ', Depth) + $"-{Entrant.ToString()}");
     }
     else
     {
         return(new string(' ', Depth) + "|");
     }
 }
예제 #2
0
 public void Split(Entrant newEntrant)
 {
     if (Left is null && Right is null)
     {
         Left = new BracketNode(this)
         {
             Entrant = Entrant
         };
         Right = new BracketNode(this)
         {
             Entrant = newEntrant
         };
         Entrant = null;
     }
 }
예제 #3
0
 public Entrant(Entrant entrant)
 {
     Name   = entrant.Name;
     Player = entrant.Player;
 }
예제 #4
0
 public BracketNode Find(Entrant entrant)
 {
     return(Root.Find(entrant));
 }
예제 #5
0
 public BracketNode Find(Entrant entrant)
 {
     return(Entrant != null && Entrant.Value == entrant ? this : Left?.Find(entrant) ?? Right?.Find(entrant));
 }