c++ question
So, I have a question.
I need to have a three-layer deep... thing. I'm not sure if I should use a three dimensional array or something else.
What I need:
So, general classes first. A list of things like "heavy weapons", "light weapons", etc.
Then, a list of things that points to each of those. For example, under heavy weapons, "rpg", "chaingun", etc.
Then, a list of things that points to each of THOSE, that have interger values. For example, under RPG: "damage", "rateoffire", "clipsize", etc.
Would I use a three-dimensional array with this? What I would need this for, is like if the user picks up an RPG, see if it's a heavy weapon, and then if it is enable certain perks for the character. Also stuff like if the user picks up an RPG and attacks with it, see what the RPG's damage is and all that, and then check what type of weapon it is to see if those damages should be altered by any of the user's perks.
an example:
(user picks up rpg)
(attacks monster)
check stats to see what the damage and rate of fire is, along with clip size and everything else
check what type of weapon it is
if heavy weapon add ten damage
if not heavy weapon, do nothing
etc etc
Can anyone help? What type of thing should I use to.. I don't know, "declare" this?
I need to have a three-layer deep... thing. I'm not sure if I should use a three dimensional array or something else.
What I need:
So, general classes first. A list of things like "heavy weapons", "light weapons", etc.
Then, a list of things that points to each of those. For example, under heavy weapons, "rpg", "chaingun", etc.
Then, a list of things that points to each of THOSE, that have interger values. For example, under RPG: "damage", "rateoffire", "clipsize", etc.
Would I use a three-dimensional array with this? What I would need this for, is like if the user picks up an RPG, see if it's a heavy weapon, and then if it is enable certain perks for the character. Also stuff like if the user picks up an RPG and attacks with it, see what the RPG's damage is and all that, and then check what type of weapon it is to see if those damages should be altered by any of the user's perks.
an example:
(user picks up rpg)
(attacks monster)
check stats to see what the damage and rate of fire is, along with clip size and everything else
check what type of weapon it is
if heavy weapon add ten damage
if not heavy weapon, do nothing
etc etc
Can anyone help? What type of thing should I use to.. I don't know, "declare" this?
