I have two classes : World
, and Entity
.
Inside of World I have two Entity pointers which I made like so:
Entity* ent1;
Entity* ent2;
I wanted to allow Entity objects to call World's public member functions. I thought was that I could simply pass in a reference or a pointer of World to the Entity.
But when I include World.h
from Entity.h
, I start getting errors.
It does seem a bit wrong as they include each other but I have no other idea of how to achieve this functionality.
In other programming languages I've seen the parent keyword, is there anything like that in C++?