Hello,
I try to extends TerrainPage and TerrainBlock but it seems that every thing I need is declared as private.
Is there a particular reason for this ?
Thank you.
That is called information hiding, and it’s common practice among programmers to make variables private and give them accessors and modifiers. More info on information hiding
Go to the location on your computer where you have the jME source code from your CVS. Look in /jmex/terrain and you’ll see the source code for TerrainPage and TerrainBlock.
Notice the accessors (‘get’ methods) and the modifiers (‘set’ methods) at the end of each source code. Those methods allow you to have control of the variables.
Just out of curiosity–why are you extending those classes?
Trussell said:
That is called information hiding, and it's common practice among programmers to make variables private and give them accessors and modifiers. More info on information hiding
Yes, and my question is : is there a particuler reason for this on these class ?
Trussell said:
Just out of curiosity--why are you extending those classes?
To modify the height maps with "Brushes" to avoid the chain use of TerrainPage.addHeightMapValue().
There's no particular that the class NEEDS to have private variables, it's just common practice to do that with all classes.