public static Bunny createBunny() { newBunny = new Bunny(); Console.WriteLine(getBunnysInfo(newBunny) + " was born!"); Thread.Sleep(50); return(newBunny); }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; Bunny bunny1 = BunnyFactory.createBunny(); Bunny bunny2 = BunnyFactory.createBunny(); Bunny bunny3 = BunnyFactory.createBunny(); Bunny bunny4 = BunnyFactory.createBunny(); Bunny bunny5 = BunnyFactory.createBunny(); Console.WriteLine("\u2639"); Console.Read(); }
private static string getBunnysInfo(Bunny bunny) { return(string.Join(" ", bunny.sex.ToString(), bunny.color.ToString(), bunny.GetType().Name, bunny.name)); }