title: Loading a variable using a String in java
body: <p>Basically, I'm having trouble loading levels in my game due to a problem with loading the tiles. What I can't figure out is how to have the program save the tile's type as a string, such as "water" or "grass", and load the tile from those strings. Here is an example of the tiles code:</p>
  
  <pre><code>Example = new TileType("Texture.png", Material.Mat, True, True, "Example");
  </code></pre>
  
  <p>The first value is the Texture location, the second is the material, the third is whether or not the tile can be destroyed, the fourth is whether or not NPCs can pass over the tile, and the last is what the tile is saved as in the level data.</p>
  
  <p>Here is what the game saves the tiles as:</p>
  
  <pre><code>&lt;tile x="0" y="0" type="Example" /&gt;
  </code></pre>
  
  <p>What I am trying to do is make a method that takes the string and finds the tile that uses it. Can anyone help me with this?</p>