title: What is a good Java data structure to store RPG Game items?
body: <p>I'm building a RPG dungeon game in Java and I'm stuck on creating a data structure.</p>
  
  <p>I have a lot of Thing objects that I can copy to populate a dungeon with. For instance, there is a bread Thing object, and a sword Thing object, a chain mail Thing object, and monster Thing(s), etc. I want to store them in a central Library and then be able to retrieve an object using certain queries. I want to store them using the following fields:</p>
  
  <pre><code>int minLevel
  int maxLevel
  double probability
  int[] types
  </code></pre>
  
  <p>So a rusty sword would have a <code>minLevel</code> of 1, a <code>maxLevel</code> of 3, a <code>probability</code> of rarity(3%),and <code>[type.SWORD,type.WEAPON,type.ITEM,TYPE.EQUIP]</code>. A better sword would have <code>minLevel</code> 2, <code>maxLevel</code> 10, rarity (1%).</p>
  
  <p>Then I want to retrieve a random <code>type.SWORD</code> from the library and say I'm at level 3. I should get a rusty sword more often than the better sword based on their probabilities. If I retrieved a <code>type.SWORD</code> from the library requesting level 10, I would only get back the better sword.</p>
  
  <p>I hope this makes sense.</p>
  
  <p><em>EDIT</em>
  At the initialization stage, all the basic objects will be created. Things like the available weapons, armor, foods, potions, wands, all the basic possible Things that have a unique graphic tile in the game. Then when I want to place an object somewhere, I just make a copy of one of the available Things, adjust it's stats a little, and plunk it down in the world. The actual items are all subclass of the root Thing class, such as class Creature,Item,Equip(extends Item),Weapon(extends Equip),Armor(extends Equip),Food(extends Item), etc. But I want to tag them different in the Library database, I want to use extra tags, such as type.RARE, type.ARTIFACT, type.CURSED, so I want extra tags besides the class.</p>
  
  <p>The game use LIBGDX to be available on Android and as an Applet. I use the free Rltile set, which has thousands of good tiles. I will use Pubnub or Google App Engine to provide multiplayer support.</p>