mccoyst / min-game

Automatically exported from code.google.com/p/min-game
MIT License
2 stars 1 forks source link

Better world, animal, item, etc. serialization. #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the world is first, and *everything* else is read in as the 
json-encoded animals.  We obviously want more than just the world and animals.

My idea to fix this is to have a typed encoding for everything following the 
world.  This will be a header stating the type (or just a name, whatever) of 
thing, the number of bytes of its encoding, followed by its encoding (probably 
json for everything).  This way, the order of items following the world doesn't 
matter.  We can read the header to get the type and size of the next item, then 
based on its type, decode it to the proper place.

Original issue reported on code.google.com by burns.ethan@gmail.com on 9 Dec 2012 at 6:10

GoogleCodeExporter commented 9 years ago
Same as 80, really.

Original comment by burns.ethan@gmail.com on 9 Dec 2012 at 6:26