Brain fart. Any suggestions?

+2 Adam Karrer · September 30, 2014
Hey guys, I'm reworking an old text based RPG game I made awhile back, and I'm trying to figure something out. I'm using enumerated data to create a list of items, and I want to be able to make multiple types of those items. I know I could create classes, but that seems like a lot of work for something simple. Example:



  enum item_type {POTION, SWORD, SHIELD, MANA, STAFF, DAGGER};


Is there a way to make a subtype of each data type? For example a BASTARD.SWORD or BIG.POTION without creating classes for them?

Post a Reply

Replies

Oldest  Newest  Rating
0 Thomas Default · October 4, 2014
I think you would have to create a new Enum for each if anyone knows how to do what he is asking I would like to know.
  • 1

Java / Android Development

107,065 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator