In my RPG, all Food objects should be possible weapons. For instance, I want the player to be able to to try kill bunnies with a cherry or a watermelon.
The problem is that the easiest way to do this is a bit counter-intuitive (and ugly, IMHO):
Item < Weapon < Food
(superclass < subclass)
I wrote an interface (IWeapon) and made Weapon and Food implement it, but the amount of repeated code was ridiculously huge (what indicates that they should share a common class, right?).
I do not think that I want Potions, for instance, to be usable as weapons (I don't want to let the player hit the target with a filled vial).
How should I solve my current problem? Should I use inheritance or program to the interface?
What about extensibility? Does it make sense to let all items have attributes such as damage, hitRate, integrity, etc.?