private static void FullInfo(FamilyTreeBuilder familyTreeBuilder, string[] tokens) { tokens = tokens[0].Split(); string name = $"{tokens[0]} {tokens[1]}"; string birthday = tokens[2]; familyTreeBuilder.SetFullInfo(name, birthday); }
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); } }