So i have a class called VirtualMouse, it is used to perform mouse actions such as moving and clicking.
public class VirtualMouse
{
public VirtualMouse()
{
}
public void MoveByOffset(int offsetX, int offsetY)
{
// Implementation.
}
public void MoveToPosition(Point position)
{
// Implementation.
}
public void ClickLeftButton()
{
// Implementation.
}
public void PressLeftButton()
{
// Implementation.
}
public void ReleaseLeftButton()
{
// Implementation.
}
}
This is to implement basic mouse automation. Now I also wanna have the ability to create a class that is specialized, for example a HumanVirtualMouse which would have the same methods but would move the mouse in a human like way.
Should I inherit from VirtualMouse and call the base class methods in succession to create human patterns(for example I can use MoveByOffset inside a loop) or have an instance of VirtualMouse inside the HumanMouse class?
I guess i should favor inheritance because HumanMouse is-a VirtualMouse and i only need to modify the movement methods, click, press and release remain the same...