public override void Visit(Rabbit rabbit) { if (rabbit.IsAlive == false) { return; } GainWeight(rabbit.Weight * 1.0); rabbit.Deactivate(); base.Visit(rabbit); }
public override void Visit(Rabbit rabbit) { if (rabbit.Gender == Gender) { return; } for (int i = 0; i < 2; i++) { var gender = (Gender)Random.Next(0, 2); var bunny = new Rabbit(this.spawner, gender); this.spawner.Spawn(bunny); } base.Visit(rabbit); }