Attach a GoldMonkeyAppState.
Parameter boolean false=load data only once.
Parameter String… set the paths of the assets subfolders that includes XML data.
Then, you should create a Builder for parsing the XML into your game, like this:
Finally, create a method that instance an item of the specified XML id:
public static GamePayload getGamePayload(String id){
return ((GamePayloadBuilder)BuilderManager.getBuilder("mygame.GamePayloadBuilder",id, GamePayloadBuilder.class)).build(myOptionalParameter);
}
Extra
Furthermore, I’ve “goldmonkeyized” an old branch of OpenRTS (unfortunately this commit is unnecessarily big as it also includes the GoldMonkey sources)
Thanks for reading and sorry if all of this sounds a bit confusing!
AppStates are convenient for extending application to have additional easily-located services even if they don’t do anything on their update() method. I do it all the time. The empty update() call costs next to nothing.
GoldMonkey is the standalone version of loader of OpenRTS; since the original version did reload all the files continuously (and thus needed update cycles), I allowed the intended original behavior.