Beispiel #1
0
    private static void ParentChild(FamilyTreeBuilder familyTreeBuilder, string[] tokens)
    {
        string parentInput = tokens[0];
        string childInput  = tokens[1];

        familyTreeBuilder.SetParentChildRelation(parentInput, childInput);
    }
Beispiel #2
0
 private static void ParseInput(FamilyTreeBuilder familyTreeBuilder, string input)
 {
     string[] tokens = input.Split(" - ");
     if (tokens.Length > 1)
     {
         string parentInput = tokens[0];
         string childInput  = tokens[1];
         familyTreeBuilder.SetParentChildRelation(parentInput, childInput);
     }
     else
     {
         tokens = tokens[0].Split();
         string name     = $"{tokens[0]} {tokens[1]}";
         string birthday = tokens[2];
         familyTreeBuilder.SetFullInfo(name, birthday);
     }
 }