The gamedata class makes this possible. By declaring but not defining it before map and army classes are defined, both of these classes can access gamedata.
There would be other public member functions added to gamedata - e.g.
int getarmyidatlocation(int x,int y) ;So for any location x,y, the function getarmyidatlocation() is called and if it returns a non zero id then getarmyfromid() returns a reference to the army. There's no guarantees that there is an army at every location so we can't just return a reference from the location coordinates. It needs these two function calls. Other functions we'd add would include addarmytomap() and removearmyfrommap().
army & getarmyfromid(int id) ;
This concludes this tutorial. However, we'll encounter references again in the tutorial on Copy Constructors which will appear shortly.

