Originally posted by Krusty
Actually, every time you add a new variant you are, by definition, adding and changing and varrying the code.
Not in object oriented programming you're not... The programming I do is not in PC's so now you can watch me get my words all tangled... But please trust that I understand the concept...
You have a basic set of values for a plane, and you have child classes that are derived from that original... Within that you only add or modify the values needed for the new instance... You don't necessarily have new code in the Parent aircraft.
I can over simplify by putting it like this,
Suppose you have a plane called a P99... Its got 3 varients.. P99A, B, and C.
You would set up your Parent such that it has all the information that is shared among all of the aircraft of that type... For sake of argument lets just say the cockpit, wingspan and chord... etc are the same between all of them... You set that up in the parent..
Now, lets say the B model gets a bigger engine... All you need to do is create a child that is derived from the basics of the A model and change the engine data for it... Everything else is just as it was...
So, you're not really risking damage to the Parent... Any of the faults of the varients will be specific to that varient.
And by the same token, you aren't programming whole planes each time... simply the parts that are different.