I have a class [BaseClass] that has a the following code:
Then I have a class that inherists from BaseClass called [CharacterClass] and it has the override function of A(int nSomething) as follows:
What I was expecting was that in the BaseClass when I called A(nSomething) I hoping it would actually use the function in CharacterClass (the inherited function) as opposed to the virtual one in BaseClass itself.
As you could expect, the code in CharacterClass [A(nSomething)] is never executed, instead the virtual function in the base class BaseClass is run - which has nothing in it ...
So, obviouslly I need a way around it - is there anyway to accomplish what I am trying to do? The code to launch "A" should be in the BaseClass but the actual effect of "A" needs to be in the inherited classes, but how the hell do I accomplish that?
Any ideas, hints, and help would be greatly appreciated, thanks
Code:
...
if (SOMETHING)
{
A(nSomething);
return true;
}
return false;
}
public virtual void A(int nSomething)
{}
Then I have a class that inherists from BaseClass called [CharacterClass] and it has the override function of A(int nSomething) as follows:
Code:
public override void A(int nSomething)
{
// DO ALL THE REAL WORK
}
What I was expecting was that in the BaseClass when I called A(nSomething) I hoping it would actually use the function in CharacterClass (the inherited function) as opposed to the virtual one in BaseClass itself.
As you could expect, the code in CharacterClass [A(nSomething)] is never executed, instead the virtual function in the base class BaseClass is run - which has nothing in it ...
So, obviouslly I need a way around it - is there anyway to accomplish what I am trying to do? The code to launch "A" should be in the BaseClass but the actual effect of "A" needs to be in the inherited classes, but how the hell do I accomplish that?
Any ideas, hints, and help would be greatly appreciated, thanks