I have two classes, class “entity and class “tile”.
Class “entity” has some member functions that uses a global array of type “tile”. It also uses some defined numbers.
Class “tile” contains a member variable that’s a pointer to type “entity”.
I want to separate the classes into various .h files. I’m going to try and restructure it, but I do want to know if it’s possible to do this.
So, again, for clarity:
“entity” uses global 2d array of type “tile”
“tile” uses
Is there any way to split this up into three .h files (one for each class, and one for all the global variables and defines)?
Thanks!
I don’t see it why do you need three .h files. Just make a unit for each class, and put the global into Entity‘s module (I wouldn’t argue that you could possibly avoid globals).
Entity.h
Entity.cpp
Tile.h