I am using this sort of a class an I'm wondering if it's ok to have an access to other classes like this. If not what are the downsides and what would be a better way. Thanks.
I'm guessing this is a game you're programming? It looks like maybe your RenderSystem and EntityManager are too entangled; why does the RenderSystem need a handle to the EntityManager?
Maybe instead you could pass some container containing your entities to the RenderSystem in a function call. Something like:
I used to do what you're doing, which is basically giving every separate system a handle to every other system. The problem is that when you do this, you risk not fully separating out the duties of each subsystem. I prefer to send only the necessary data to a class via function calls because you are then less likely to mix up the roles of your classes.
EntityManager is just a container with a few helper functions. Something like:
struct EntityManager{
int CreateEntity();
int mask[ENTITY_COUNT];
Texture textures[ENTITY_COUNT];
// And so on
}
I'm using the handle just to access render components and mostly don't call EntityManager functions from other managers. I got the idea from a gamedev.net article and it seemed like an easy way to implement entity-component system.