I've read some on properties and i'm not sure if thats what i want or not. Basically i have an abstract projectile class so that all "bullets" have a common implementation That any "weapon" they are attached to can expect to be able to use.
I know you can declare an abstract class and force the functions you declare inside it to be defined. I'd like the same thing with the variables (i think, obviously this functionality doesn't seem to exist so perhaps i'm thinking about the solution wrong)
My issue is that since all "bullets" should have a damage i'd like to be forced to declare in code the damage value of a bullet.
There may be a case where the round is from a stun gun and it does no damage but I feel that I should still be made to declare it for 2 reasons.
The explicit declaration in the code of this does zero damage is worth the one line of code. You don't have to go well I guess it does none since it says nothing about damage it's explicitly stated.
Debugging (this is the main reason the other is minor) I want to be forced, so I don't forget. I don't want to mistype the variable name or forget to assign a value altogether and hunt for a half hour trying to figure out why my rocket or missile or bullet or whatever isn't doing any damage or is doing exactly 1 or the amount of the last projectile I used or whatever the default value of the float variable I declared in the abstract class ends up as. I want to be thrown an error right away telling me I can't continue until my new bullet has a damage.