I was reading up on data structures in my trusty textbook on computer science, and come to think about how CivIV organizes cites and units, among other things. Are these objects ordered in a linked list, perhaps?
Because they retain their IDs even when entries (cities/units) are popped out (set to Nill/None). And then the game will backfill those empty slots with other instances of these classes later.
Also, obviously you iterate through the list of cities with the CyPlayer.firstCity() and CyPlayer.nextCity() methods. This would indicate a linked list to me, but what do I know?
Because they retain their IDs even when entries (cities/units) are popped out (set to Nill/None). And then the game will backfill those empty slots with other instances of these classes later.
Also, obviously you iterate through the list of cities with the CyPlayer.firstCity() and CyPlayer.nextCity() methods. This would indicate a linked list to me, but what do I know?
