jacovanniekerk/gapaint — pull request #1 by nicokruger (2011-12-31 05:48:13+00:00)
Title: 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 pull request en laat my weet!