I have two classes from third party libraries that have very similar functionalities lets call them class Car and class Bike. I cannot directly make changes to the class but I want to be able to abstract them so that I can use them like so
public bool drive(IDriveable vehicle)
{
vehicle.Start();
vehicle.Shift(Gear.Drive);
vehicle.Accelerate();
//so on...
}
Is there anyway I can do this?
Aucun commentaire:
Enregistrer un commentaire