i've run into a bit of a problem while creating my own game engine in C++. I want to have two objects:
an ObjectCreator class, and a Player class. The object creator can create a player, and the player can use the object creator to create bullets. The problem is, using both header files for each other would cause the game to not compile. Simply declaring the class in the header file without #include wont work, because i would not be able to access the functions that way.
Heres an example:
#include "Player.h"
class ObjectCreator
{
public:
ObjectCreator();
void CreatePlayer();
}
#include "ObjectCreator";
class Player
{
Public:
Player();
CreateBulletsWithObjectCreator();
}
So, does anyone have a solution to this problem? any help is appreciated :3