private static void Main() { Adam adam = Adam.GetInstance(); Eve eve = Eve.GetInstance(adam); Male seth = new Male("Seth", eve, adam); Female azura = new Female("Azura", eve, adam); Male enos = new Male("Enos", azura, seth); Console.WriteLine(((Human)enos).Name); Console.ReadKey(); }
public static Eve GetInstance(Adam adam) { _adamInstance = adam ?? throw new ArgumentNullException(); return(_eveInstance ??= new Eve(_adamInstance)); }
private Eve(Adam adam) { _adamInstance = adam; }