VoiceOfUnreason
Deity
- Joined
- Dec 5, 2005
- Messages
- 3,663
I've a question...
Gee, whatever could it be...?
Do trade network need to have a 2 way trade route possibility to be established? Or even only a one way trade route possibility does the job? And if it does, it does for both sides?
Nuts. I knew that was coming.
I guess an extra dose of clarification is in order, based on the vocabulary that you are using. The game is actually testing membership of PlotGroups, which are collections of trade network connected plots. PlotGroups are NOT shared between players on opposing teams (I'm not sure if they are shared by teammates - my believe is that (a) they must be and (b) the effort required to check is not justified). Instead, these structures define groups of tiles that are trade network connected for a particular player.
So in this sense, the trade networks are bi-directional: if ( from the point of view of player 1 ), Plot A is trade network connected to Plot B, then A & B are part of the same PlotGroup, and therefore checks to see if B is connected to A will return true.
Where things have the potential to get interesting is the fact that the connection between B & C depends on whose PlotGroups you look at. In other words, there are circumstances where player 1 may view A and B as part of the same plot group, where player 2 does not. Then what?
In the case of CvCity::doReligion, the code logic goes to CvCity::isConnectedTo(City*), which in turn goes to CvPlot(City*), which checks to see if the cities are connected from the PlotGroups of the owner of city A, and from the PlotGroups of the owner of city B. This check is a logical OR operation - so it is reasonably valid to say that the two directions are equivalent.
This is why I was surprised at the notion in the other discussion that the connection might be unidirectional - the developers would have had to deliberately bypass CvCity::isConnectedTo, but in doing so they don't appear to have created a CvCity::isHalfwayConnectedTo. Now, that's your work, not mine, so I'm not particularly motivated to code dive to see what other definitions of connected might be in play. My responsibility there ended when I warned you that you might be full of it.
The usual disclaimer, that the game DLL may not actually match the SDK, is still in effect. Also, I point out that I leave the bread crumbs so that doubters can catch me when I've misread the source.