In the part of the course about the Strategy Pattern, the abilities are created as classes that implement an IAbility interface. I am wondering why this is preferred over having an abstract Ability class and having ability classes that inherit from it. This allows the parent classes to have common functionality and not reuse code. If two abilities are very similar and do some of the same functionality then the interface approach requires the code to be repeated in both classes, but with inheritance they can inherit from an abstract class that defines the functionality only once, allowing for it to change without having to change code in multiple places.
I am sure there’s a good answer to this, but I don’t understand the advantage to the interface method in this example. Thank you.
EDIT: this was covered in the next lecture. Hadn’t watched that one yet.