public void AttemptBirth(string name, int age, int birth_age, bool IsCanProduceTree) { Birthday(); if (birth_age >= 0) { if (Age < MinBirthAge) { return; } } if (this.IsCanProduceTree) { for (int i = 0; i < rabbits.Count; i++) { rabbits[i].AttemptBirth(name, age, birth_age, IsCanProduceTree); } } var rabbit = new RealRabbit(name, 0, birth_age, IsCanProduceTree); rabbit.DOB = DateTime.Now.ToString(); rabbits.Add(rabbit); }
void Initialise() { GrandPa = new RealRabbit(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(1000); timer.Tick += TimerTicked; ImageRabbit.Visibility = Visibility.Hidden; PopulateListBox(); }