I hope you can help me with this c# question. I have some classes like:
public abstract class Animal
{
public abstract void Walk(int param1,int param2);
}
public class Cat : Animal
{
public override void Walk(int param1,int param2){}
}
public class SmallCat : Cat
{
public override void Walk(int param1,int param2){}
}
public class Dog : Animal
{
public override void Walk(int param1,int param2){}
}
And I have a controller class for all animals.
someAnimal.Walk(a,b);
My question is : I dont want base class to know all details about moving but I need more parameters or different parameters for different animals on Walk function. What is good way to solve this?
By the way the changing parameters are only needed when the different user (controller) takes control of the animal.
After reading your comments I've decided to use a simple UserController class which has all user(changing parameters) details, and send this to Animal class when it takes control of it.