Well, that kind of happened in the last two days when I was spending time searching for a solution for a problem that doesn't really exist.
Here's the "pseudo" problem :
I have a map class that should be able to store all entities that are on a map into a save game. Therefor I have to save every entity.
Now, to create an entity, I normally use a template that is managed by my entity manager and that is stuffed into a category within the entity manager. To address a given template I only use the category and the name.
When saving the entities within the map file, I have to save the category where they are located because the next time I have to load the file, I have to be sure that the categorisation is still the same.
*BUT* the entities themself don't know anything about categories. So when I started to write the code (within the map class) to save the entities, I stumbled on the fact that I couldn't clearly access the category of an entity.
You see the trees ? So did I... but there was something hidden in the forest which I didn't consider :
The entity manager has, beside a LoadTemplates() function, a LoadEntities() function which can be used to load entities from a file directly into the entity management part of the entity manager. I simply have to write a save function there. The entities *are* stored in categories within the entity manager.
Doh is all I can say on this matter... I really did a Homer there.