1
\$\begingroup\$

I am working on text-based Diablo-like RPG, where each weapon and armor has unique stats and names and there is a lot of overlap. Ie I can generate Silver Sword with 40 damage, but I can also generate Silver sword with 20 damage. So those items can't obviously be stored as one value. I am thinking of storing the items in multidimensional array where one column would store weapon name and the other column would be used for storing the damage. Same for armor etc. But I feel this may get cumbersome and spiral out of control very quickly.

Is there any other data structure I could use and have more flexible and efficient solution?

\$\endgroup\$
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.