/// <summary> /// grandMom <---+ +---> grandDad /// | | ^ ^ /// | | | | /// | | | | /// Mom<--- son | /// ^ | /// | | /// +--------- daughter /// </summary> Human MakeFamily() { var grandDad = new Human("grandDad"); var grandMom = new Human("grandMom"); var mother = new Human("Mom", grandDad, grandMom); grandDad.Children.Add(mother); grandMom.Children.Add(mother); var son = new Human("son", grandDad, mother); grandDad.Children.Add(son); mother.Children.Add(son); var daughter = new Human("daughter", grandDad, mother); grandDad.Children.Add(daughter); mother.Children.Add(daughter); return mother; }
public Human(string name, Human father = null, Human mother = null) { Name = name; Father = father; Mother = mother; }