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:
Example = new TileType("Texture.png", Material.Mat, True, True, "Example");
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.
Here is what the game saves the tiles as:
<tile x="0" y="0" type="Example" />
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?
Map<String, TileType>?DocumentHelper.parseText()