Quote:
Originally Posted by Nochte
It is not. Should I create a completely virtual base class Player, then derive AIPlayer and HumanPlayer (currently, Player is a human player) from it?
|
Doesnt matter how u do it, thats all preference but when you inherit methods you want ot be different the base class has to be virtual and the class inhereted to needs to override those methods to perform them differently.
Examples
Code:
public class BaseClass
{
public BaseClass(){}
public virtual void Foo() {}
}
public class InheretedClass : BaseClass
{
public InheretedClass() : base() {}
public override void Foo() {}
}
In this instance, if i cast InheredtedClass as a BaseClass, and call Foo it will call it at its InheretedClass level.