New class can be found here
*Added a objectGroupNameToOffset
HashMap. Now when you want the offset of a group, you can get it by its name
*Added a objectGroupToGroupObjectOffsetMap
(Yes its a very long variable name) HashMap. Its pretty hard to get your head around (it was for me) WTF this does. Well to put it simply, it lets you get objects (the entire object class, not just snippets of data like the x or y) by their names, not their offsets. No more of those annoying for loops. Basically this is how the HashMap works.
You first get the group, in which the object is stored. Say the group is called entities and the object is called player.
This will return another HashMap of the object name mapping for this object group. So if I wanted the offset of the object called player in the entities group, Id'e get it like this
This would return a GroupObject
containing all the info (name,x,y,width,height etc.) about an object which you can freely access.
The good thing about 0.2, is that you can have another object called player in another object group, and they won't overwrite eachothers data (see above post). Isn't that sweet?
Of course you won't need to use all of this
in your code, Iv'e created (and am still) functions that wrap this data for you. Here we go...
*Added getObject(String groupName,String objectName)
*Added removeObject(String groupName,String objectName)
*Added addObject(int x,int y,String type,int width,int height,Properties props,String group,String name)
The addObject function was really annoying. Since I couldn't create my own constructor for the GroupObject
class, I had to serialize all the data (name,x,y etc.) into an XML format and then construct the object.
*Added putProperty(String groupName, String objectName,String propertyKey, String propertyValue)
*Added removeProperty(String groupName, String objectName,String propertyKey, String propertyValue)
Well that's all Iv'e done in this update. Probably time for me to go to bed soon (I'm in Australia mate). I need some people to test this code, as I have been writing it for 3 hours straight ( -_- ) and haven't had any time to test it. Probably the next function I'm going to implement is the writeMap function. For those who don't know, the writeMap function will write all data in memory about all the TiledMap objects, back to an XML file or string buffer. This will take me a while...[/i][/b]