After total of almost 30 posts I get the answer I have been waiting for.
You've
gotten the answer already, you just didn't seem to have learned anything from it.
If you ever want to make anything significant with C++, or any language, you're going to have to learn how to apply knowledge of the language to your own programs yourself. You
are going to run in to scenarios where things are broken in a mess of thousands upon thousands of lines of code and you have absolutely no clue what to do. Even if the problem is really simple, and was just caused by a lack of understanding in the language, you definitely will not be able to post it on a forum and have someone correct it for you.
This question shows a lack of understanding in how objects, a fundamental feature, work in C++. As well as the inability to manage how variables are accessed. This certainly will not be the last problem of yours.
World::World()
: windowManager(windowManager) //This is the initializer list
{
std::cout << "World constructor" << std::endl;
//here i initialize tile stuff, no problem, i cut it out.
}
It gave me error, but I fixed it by inserting parameter WindowManager& windowManager to constructor.
Now it compiles and doesn't call the constructor twice, thank you.
So it looks like this:
World::World(WindowManager& windowManager)
: windowManager(windowManager)
Is that correct way? Or is there something I should do differently?
Yeah, sorry, I must have missed that.