Example #1
0
        public bool StoreEggInNursery(Egg egg)
        {
            // Check if there is space
            Rectangle newcrib = new Rectangle(egg.Location, new System.Drawing.Size(CRIB_SIZE, CRIB_SIZE));

            foreach (Egg crib in Nursery)
            {
                if (newcrib.IntersectsWith(new Rectangle(crib.Location, new System.Drawing.Size(CRIB_SIZE, CRIB_SIZE))))
                {
                    return(false);
                }
            }
            eggs.Add(egg);
            return(true);
        }
Example #2
0
 /// <summary>
 /// A new star is born !!!!
 /// </summary>
 /// <param name="egg"></param>
 public abstract void Hatch(Egg egg);