Hey, this is less of a "How do I specifically" and more of a "What's the best way to do this" kind of thing.
The situation:
I have a split-screen UI as the entire viewport of the game. Half the screen is a 2D map. Right now literally just a ColorRect with a starfield type material on it. Ships, asteroids, planets, and other objects in the solar system depicted in the 2D map will each reside there, and will move around (not looking forward to the orbital mechanics, that'll probably come much later). The other half of the screen is a few containers that ultimately contain a Tree node that should be a list of all objects on the map.
The third component of this is an Autoload I've made that keeps a dictionary of all objects in the star system (on the map), with some basic details on them, including name, type, and an object identifier that's just an integer. Right now I call that my ObjectRegistry. I have an InWorldObject class that contains a lot more details, including the OID, and my goal is for each object on the map to correspond with an instance of InWorldObject or something that extends it.
Right now, when I instantiate a new InWorldObject, I do so from the tree, which exists in the main scene. The tree simultaneously instantiates an InWorldObject and accesses the ObjectRegistry to use the same instantiation arguments to register the new ship.
My question:
What's the best practice for keeping these three different expressions of the same object in sync? My current idea is to have either the tree item or the object on the map be the actual InWorldObject, with the other stuff just referring back to it. But I'm worried that if I ever want to have objects not on the map, that would require a major refactor. It would also mean I'd have to autoload the Map and the Tree as well as the registry, which may or may not be a problem.