View Single Post
Old 02-14-2007, 04:50 PM   #8 (permalink)
Jeff
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 27
Posts: 4,876
Default

Quote:
Originally Posted by Nochte View Post
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.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote