What I want is a class that contains objects and variables that can be accessed by any other class without needing to create an object of that class or get a reference to that object from the class that creates it. I know that in Java a could just create a static class that would do this but it doesn't seem like static classes exist in C++. How can I accomplish this?
Let me clarify further exactly what I'm looking for.
Say I have a class called "mob" which on update, seeks out the player and moves toward him. I could do this by putting a reference to the player in the update function of the mob, or better yet just create a pointer in the mob class that is assigned to a reference of the player on initialization. However, what I really want is to just be able to include a header like "Global.h" and put the player in there. Then when the mob, or any other object in the program wants to get some data from player, it can just use something like Global.player.GetPos()
Or maybe this is terrible practice that I should forget about right now. In which case, please tell me a better way to do this whole thing. Thanks.