TiledSharp icon indicating copy to clipboard operation
TiledSharp copied to clipboard

JSON parsing?

Open seiyria opened this issue 8 years ago • 4 comments

Will this support the JSON export of Tiled as well?

seiyria avatar Jan 27 '16 18:01 seiyria

I considered it at one point. At the moment the xml parsing is very explicit, and generalising the parsing could be a bit of work. But I agree that it ought to also read JSON. I'll try a more serious attempt to get it working. Thanks for raising the issue.

marshallward avatar Jan 27 '16 20:01 marshallward

One very easy (but lame) solution is to convert the JSON to XML and then parse it internally :).

marshallward avatar Jan 27 '16 20:01 marshallward

No problem. I'm not sure how well that would work, and to be honest, I'm not sure how it would work if I did this anyway. I have custom fields in my maps and I don't know how well that'd transfer.

seiyria avatar Jan 27 '16 20:01 seiyria

I don't think custom fields would even be picked up... which I suppose highlights that this class is not much more than an XML wrapper with some convenient datatype casts :).

I will keep this issue open though, JSON should be handled somehow, even if it's just as a thin wrapper to XML.

marshallward avatar Jan 27 '16 22:01 marshallward