jacovanniekerk/gapaint — pull request #2 by nicokruger (2011-12-31 06:04:01+00:00)
Title: Can now dump eastate to JSON using DumpMain.

Added to json functionality

A new main class was added, DumpMain. Running this, and giving two arguments (in and out), will read the "eastate" file from in and dump it as a JSON object into "out".

The structure of the JSON object is available inside the JsonHelper class. Json requires a top-level object to be valid, so the top level structure is: { background: , polys: [] }. For more details on the exact structure of the object in the polygon list, consult JsonPolygon and JsonColor etc. classes inside JsonHelper.

JsonHelper also exposes one static method: toJson, which takes a GASolution and returns a JSON string.

At the moment of course, this JSON repr is only used by my little test animation project, but perhaps in the future there could be other uses? JSON is a way more portable format, so looking at integration with other systems in the future I think this is a worthwhile addition for the main project.

Anyway Jaco, enjoy jou eerste (proper) pull request en laat my weet!

(Ek belowe hierdie een is skoon en REG gebase)