Just want to post notice and give an opportunity for objections to a change I'm going to make to our System objects (that means you, Zach
). As initially implemented the System has a map that stores pointers to Universe Objects that are in orbit around the star. This causes a number of complications when it comes to XML decoding and sort of breaks our paradigm that objects are contained by the Universe object map and referred to by ID's elsewhere. The primary benefit of it is to allow predicate iteration through system objects. The problems are that a) it would require ordered creation of objects at the client side so that the orbitting objects exist and have objects to point at when the system is created (this is not that hard to work around), and b) the System stores the pointers as non-const, but the client object lookups only return const pointers. (b) gives a few options:
--Create a non-const lookup in the client
--Have the system object store the pointers as const
--Have different implementations of System for client and server
--Have the system object store ID's instead of pointers
My feeling is that the best solution is to just make the system map hold object ID's as it will be more consistent with how we handle references in similar cases (ships in fleets, universe_object lists in Empire) rather than creating more special exceptions for what is already a special exception. If desireable we can create some utility functions for the more commonly desired predicate searches (ie planet lookup, fleet lookup). I would be willing to hear other proposals though.. I am actually making this change already so that I can progress with the encode/decode work, but I'll reverse the change if a convincing case is made.