Not a code question but a design one.
I have a parent class : Item
.
From this class, inherits two children classes : Weapon
and Armor
The class Item
contains generic parameters such as Name
, Weight
and Price
.
The class Weapons
contains parameters relatives to a weapon (category, damages, range...)
The class Armor
contains parameters relatives to an armor (bonus to AC, spell failure, speed modifier...)
For now, I can easily create objects that are either a weapon or an armor.
But how can I manage to create an object such as a lantern shield, a buckler or a pata that are simultaneously a weapon and an armor ? I know that I have to change my design to achieve that, but can't find a way to do it.