I got a class Fruit
that has a lot of variables: mass, taste
... etc.
I got a class Apple
that has a few more variables added to it: size, texture
... etc.
I wrote a simple function that loads the Fruit variables, and don't want to copy all of it to fill the Apple variables too.
public void ReadFruitData(string Name, ref Fruit newFruit);
public void ReadAppleData(string Name, ref Apple newApple);
I wish to call ReadFruitData
from ReadAppleData
, but not quite sure how to do it, since I can't pass newApple
as newFruit
class Apple : Fruit
Any ideas how I can achieve that?