Let's say I have two very simple classes:
GameObject
and
GameObjectComponent
Each GameObject has a list of GameObjectComponents.
I'd like my GameObjectComponent to have a reference to the GameObject it currently "belongs" to.
If these two classes are stored in different files then I have a circular reference problem. (eg. GameObject needs to know about GameObjectComponent, and GameObjectComponent needs to know about GameObject)
What am I doing wrong? I really don't want to store these two classes in the same file...
GameObject
and
GameObjectComponent
Each GameObject has a list of GameObjectComponents.
I'd like my GameObjectComponent to have a reference to the GameObject it currently "belongs" to.
If these two classes are stored in different files then I have a circular reference problem. (eg. GameObject needs to know about GameObjectComponent, and GameObjectComponent needs to know about GameObject)
What am I doing wrong? I really don't want to store these two classes in the same file...