GoldMonkey is... well, gold!

With the help of the awesome OpenRTS team, I’ve finally released the first version of GoldMonkey!

https://github.com/Pesegato/GoldMonkey/releases/tag/v0.0.1

What is this?

A library for loading resources in XML format

How to use it?

Attach a GoldMonkeyAppState.
Parameter boolean false=load data only once.
Parameter String… set the paths of the assets subfolders that includes XML data.

stateManager.attach(new GoldMonkeyAppState(false,"/data/test","/data/otherdata"));

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! :stuck_out_tongue:

2 Likes

I like it, but is there a reason it needs to update every frame (why is it an appstate?)

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.

http://cdn.memegenerator.net/instances/400x/24136880.jpg

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.

2 Likes