A bit of a tricky question, so I will try to explain everything in its fullest.
I am trying to replicate some of the Terrarium work done by the Microsoft guys, but I dont want to look at any of their code.
Anyway I have my base class which is an organism. This has a number of variables and methods. These methods/variables fall into a number of categories:
A) Only base class can access it (private)
B) Everything can access it (public)
C) (the interesting one), methods that only the "engine" can access and not any classes that inherit off the base.
The reason behind this is that the base class contains functionality for resolving fights, exchanging energy, scanning for enemies etc, aging the organism. The engine needs access to the aging method specifically, but I dont want any inherited classes to access the same function - as the "child" classes will be written by a third party.
Does that all make sense?
My question is, how can I define a method/variable in the base class such that it is available externally, but not to any classes that inherit from the base.
Thanks in advance
Edited 6 Years Ago by steaky1212: inheritance base classes