Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  Print  
  Revenge of the Titans Source Code  (Read 5793 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

JGO Neuromancer
****

Posts: 1063
Medals: 30


mooooo


« Reply #30 on: 2011-10-07 01:36:57 »

JSON without the unnecessary quotes would probably work quite nicely.

A couple weeks ago I pulled my JSON stuff out of libgdx for standalone use:
http://code.google.com/p/jsonbeans/
It is a tiny lib that round trips objects <-> JSON automatically. It can also parse into map/lists/strings/floats if you prefer. You can do "json.setOutputType(OutputType.minimal);" and get a JSON-like data format that only has quotes where needed. I hadn't thought about making some commas optional, I'll give that some thought. I haven't benchmarked it, but performance should be reasonable. Parsing is done in one pass using a Ragel generated state machine, but I didn't bother to support streaming. Emitting is streamed. Some speed could be gained by using ReflectASM for the reflection.

Offline Eli Delventhal
« League of Dukes »

JGO Kernel
*****

Posts: 3575
Medals: 44


Game Engineer


« Reply #31 on: 2011-10-07 13:09:22 »

Ooh, that's nice, Nate. I use SBJSON in Objective-C and haven't done much in Java so I didn't have an equivalent library to use.

See my work:
OTC Software
<br />
Currently Working On:
Secret project...
Quote from: _Riven
I edit JGO in production, because I simply don't waste time writing bugs
Offline lastaid

JGO n00b
*

Posts: 22



« Reply #32 on: 2011-11-17 07:03:01 »

This is awesome Smiley Thank you!
Pages: 1 [2]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.074 seconds with 20 queries.