I recently restructured my game due to a design flaw in my building classes.
To be specific, there are 4 main categories of buildings (residence, food, work and storage) which were all drived from one building super class.
At some point i realized, that i want an earlygame building that provides some food and a basic residence to my npcs. So i moved these functionalities into actor components. Works like a charme as long as the components work independently.
Now i want a work comp to access the storage comp of the same building to use up, create or refine resources.
I currently initialize references by the building on creation. It works but does not look clean to me.
Any suggestions on how to properly solve this, if possible without any line of code in the building ?