Another inheritance question on best practice.
if i have weapon property
get projectile
set projectile
and
ballistic weapon
but ballistic weapon has a ballistic projectile (which inherits from projectile)
do/should I make a new property or override the old one or what.
Basically ballistic weapon class has a projectile (and inherits the get/set property for a projectile from its base class weapon)
however it more specifically has a ballistic projectile which has things like projectile speed that a non ballistic laser weapon doesn’t.
So should I override the original getter/setter and have the original getter/setter be virtual or do I make a new getter/setter
I’m concerned if i make a new one that i’d end up with 2 nearly identical properties for one weapon.
it’d have the get projectile & get ballistic projectile when really the ballistic is probably all it needs (since it inherits it can do the generic stuff still as well as specific)
But I was wanting to make sure that is how people who have dealt with inheritance more would do it.
yea i think i'm supposed to used covariance to keep the ability to assign them to eachother. Working out what that means exactly now. :)
– sparkzbarca