public override Egg[] LayEggs(int numberOfEggs) { Egg[] eggs = new Egg[numberOfEggs]; for (int i = 0; i < numberOfEggs; i++) { eggs[i] = new Egg(Bird.random.NextDouble() + 12, "speckled"); } return(eggs); }
public override Egg[] LayEggs(int numberOfEggs) { Egg[] eggs = new Egg[numberOfEggs]; for (int i = 0; i < numberOfEggs; i++) { if (Bird.random.Next(4) == 0) { eggs[i] = new BrokenEgg("white"); } else { eggs[i] = new Egg(Bird.random.NextDouble() * 2 + 1, "white"); } } return(eggs); }