robn

Pioneer: Re: Savefile upgrades - a modest proposal

Jan 10th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. From: Robert Norris
  2. Subject: Re: Savefile upgrades - a modest proposal
  3. Date: Wednesday, December 19, 2012 11:09 PM
  4.  
  5. On Wed, Dec 19, 2012 at 10:24:29PM +1100, Robert Norris wrote:
  6. > To mark this in the file for the parser, we'll store a double (or
  7. > float) as [ "d", "0x9.e0652141ef0dbf6p-3" ] (that's 1.23456789). Its
  8. > still relatively human-readable (maybe human-decipherable is a better
  9. > term).
  10.  
  11. Actually the pseudo-type information isn't necessary, because you'll
  12. retrieve this value through a GetDouble() or similar method, which knows
  13. how to do the special handling required. So just storing as a string
  14. will be fine.
  15.  
  16. For Lua data, just using the native JSON type information will be fine -
  17. it maps very closely to Lua's own types. See here for what I did for the
  18. RPC agent:
  19.  
  20. https://github.com/robn/pioneer/blob/rpc-agent/src/LuaRPCAgent.cpp#L78
  21.  
  22. I don't think the precision requirement for Lua data is quite as
  23. important, so the standard JSON double stuff should be just fine for
  24. that.
Advertisement
Add Comment
Please, Sign In to add comment