I'd like to make a simple generator of names for weapons, in this format:
adjective type_of_weapon
for example:
hero's bow
Words would be stored in a text file. Name would be randomly generated from adjective and type of weapon from the file. I'd like a text file to have such format:
adjectives: // these adjectives can be combined with every type of weapon
hero's
deadly
type:
adjective_for_that_type // adjective only for this type
another_type:
...
This way you could decide which adjectives and types of weapons you would like to generate w/o changing the code. I don't know how to store words from the file after reading them. I only want a description of how to do it, not code.
You can have a map weapon type → vector of strings.
That way you can even have multiple entries for weapon type and even support for loading from different files easily.
What @MiiNiPaa said could be written as std::map<T, std::vector<std::string> > where T is the type in which you store the weapon's type. (e.g.: string)