Making a board game, best way to initialize world?
I'm working on a simple Risk-like game that will be the part of something larger. Right now I just need to get the objects interacting happily, but I'm a bit lost on how to do it.
I have a class 'Country' with a constructor that defines its name, a 'setOwner' function that changes ownership, a 'setArmy' function that sets the army, and a 'setNeighbors' function used during initialization to define which countries are adjacent. It seems like I can't use 'setNeighbors' in the constructor because if I'm initializing all the countries, I can't set neighbors until all the other countries are defined.
That seems like it'll work, but I really don't know how to organize the classes. Right now I have one file where all the classes (country, continent, player) are defined. I am trying to use arrays of 'Country' and 'Continent' defined globally so I can access them from any function. I remember from school this is fundamentally wrong, but I don't know how else to do it.
When I get to the actual main class just to test basic output and modification, I can't run the initWorld function because I can't make a static reference to a non-static.
I know I'm doing something wrong here, but I've read through tutorials and just don't know which concepts I need to apply here. What's the best way of organizing the very basic functionality of this program?
Thanks