Hello... I am very new to c++ and I have looked everywhere to try and figure out what this code does. I understand the class arguments and that after the colon is an initializer list. what i don't understand is if m_uSize is set to the value of uSize or how it exactly works. Please help. Thx.
This is simply a class constructor. You'd create an object of HillTerrain and use this constructor and pass some values to it. The values passed, seen as the parameters, are set into each of the member variables, signified by the m_. An example would be: HillTerrain myHillTerrain(2, 1.2, 1.5, 5, 0, false, 25)
Your new object, myHillTerrain, would then be initialized with the m_uSize of 2, m_fHillMin of 1.2, etc. It was a new requirement of C++11 that the constructors of classes must initialize all member variables and the colon sets the initializers for the following variables.
Errr I stand corrected. I forgot I set strict flags on the compiler. That should say that C++11 has allowed non static members to be initialized in constructors, not requiring it.