API Notice: File object inputs, Layer integration
marshallward opened this issue · 7 comments
This is a notice and request for comment on upcoming API changes. This will resolve a number of outstanding issues (#15, #25, #28).
The next tagged release will adopt the following changes:
-
TMX files will no longer be specified by filepath. Instead, the
Map
object will be created using an already-opened file object. While this will require additional file and resource management from the user, it will eliminate any filesystem dependencies from TiledSharp. This will also allow compilation as a Portable Class Library, and run on a greater number of platforms. -
The
ObjectGroup
andImageLayer
lists will be merged intoLayers
, which more closely resembles the TMX layout format. Elements can still be accessed by layer name, so this should not introduce any major problems.If two layers of different types were using the same name, then there may be some internal namechanges, but this is probably not a major issue.
The following change is also being considered:
- Removing the DotNetZip code dump and replacing it with a .NET 3.5 compatible zlib library (possibly ZLib.Portable). This would address issues #15 and #16.
The following changes have been completed:
Tiles
withinTileset
are now stored as anid
-index Dictionary, rather than a list (as suggested in #38)DotNetZip
has been removed, zlib support now provided byDeflateStream
over data section
Any comments on these changes (including approval) can be posted here.
Sounds good. As long as it still works with Unity I'll be a happy bunny :) Thank you for TiledSharp!
As long as "Instead, the Map object will be created using an already-opened file object" means we can pass a Stream
into it, everything should be good.
I haven't followed up on this as I liked, but yes - the intention was to have a Stream
input in place of the path-based constructor, which has been more trouble than it's worth.
Things have finally calmed down for me workwise, so hopefully I'll have time to get this finished up.
Would it be possible to have an overload where you pass a string
as well?
Yeah I'm OK with that.
Any word on these changes? I've been using TiledShape in my own personal project and made some modifications to it similar to #28. I've also written some code that allows loading maps that have infinite size, if you'd like me to make a pull request for that at some point.
It's probably obvious to everyone that I've had to put anything related to this project at the bottom of my work (I haven't looked at C# code in years), so I think at this point it's up to others to improve things. So I'm sure that others would welcome the changes you've made, and I'm happy to integrate them.
I'm also open to handing this project over somewhere else, such as a Tiled organization or something similar.