desocupado
Magister
- Joined
- Nov 17, 2008
- Messages
- 1,802
It's actually surprising I didn't run into it until now.
I have circular includes. -> means "includes"
Map -> Grunt -> Entity -> Sludge_Cannon -> Map
Sludge_Cannon -> Oil -> (is derived from) Map_Object -> Entity -> Sludge_Cannon
Haha. :D
Sludge_Cannon is what sparked the issue. It's derived from Module (which is abstract and will probably end an interface), which is like an accessory that can give passive boosts or a spell-like ability that may affect an Entity or the map. The problem is it needs to be able to modify the Map and/or Entities, but it's contained in a vector inside entity (and right now, initialized inside the constructor of one of Entity derived classes, although that's only temporary)
Anyway, I tried forward declaration (which I might not have done properly), but it seems I can't do that if I end up using the pointers contained the classes.
So... Any takers?
I have circular includes. -> means "includes"
Map -> Grunt -> Entity -> Sludge_Cannon -> Map
Sludge_Cannon -> Oil -> (is derived from) Map_Object -> Entity -> Sludge_Cannon
Haha. :D
Sludge_Cannon is what sparked the issue. It's derived from Module (which is abstract and will probably end an interface), which is like an accessory that can give passive boosts or a spell-like ability that may affect an Entity or the map. The problem is it needs to be able to modify the Map and/or Entities, but it's contained in a vector inside entity (and right now, initialized inside the constructor of one of Entity derived classes, although that's only temporary)
Anyway, I tried forward declaration (which I might not have done properly), but it seems I can't do that if I end up using the pointers contained the classes.
So... Any takers?
Last edited: