I need some help with a question. In its most simple version, it's a life game in C++. We have a main class, Bunny, which is an abstract class, and 2 classes that extend it, FemaleBunny and MaleBunny. A bunny has the following attributes (age, name, gender, and cords (x,y) on the game board). We use the 2 different bunny classes because a male bunny should have the ability to reproduce - when he turns 3, he can look for 2 non-pregnant female bunnies and make them pregnant.
Female bunnies can be pregnant when they turn 3, and a year after they are pregnant, they can try to have a baby bunny with a random gender at an adjacent square. If they are all taken, she will die. Also when a bunny turns 6, he will die and disappear.
there are many more rules but I just want help with the simple concept so I can go on with it.
At the start, I tried doing it with the 3 bunny class, along side a Board class, which held a 2d array with pointers for bunny object, the size of the board is chosen by the user.
Then I thought it would be a "better design" to add a GameMaster class to control the game.
My main problem is that a male bunny needs to be able to iterate over every living bunny to look for ones to reproduce with, and I ran into a circular dependency problem, a bunny is trying to have an instance of the "GameMaster" in order to look at the array of all active bunnies.
So, I need an idea of how I can solve this. Feel free to change the architecture of the project and add or remove any classes if required. Let me know if there is any relevant concept I should learn to solve it.
ps I don't have the code I starting writing on this PC, but if it'll help I can try and recreate it here.