marshallward / TiledSharp

C# library for parsing and importing TMX and TSX files generated by Tiled, a tile map generation tool
http://marshallward.github.io/TiledSharp
Apache License 2.0
328 stars 87 forks source link

Load maps from streams and xdocuments. #33

Closed ShawnCowles closed 7 years ago

ShawnCowles commented 7 years ago

Addresses issue #32 by exposing constructors for creating a map from a stream or an XDocument loaded directly.

The seemingly unrelated change to TiledCore is due to ReadXml not always being called now, so we need a non-null TmxDirectory.

marshallward commented 7 years ago

Thanks, this looks great, I will merge it.

marshallward commented 7 years ago

Sorry, I may have merged this prematurely. The first commit (iostream) is working fine, but I'm getting some sort of assembly error from the XDocument constructur when I do new TmxMap("some_map.tmx"):

/home/marshall/src/Tesserae/src/Mosaic.cs(19,19): Error CS0012: The type System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced. Consider adding a reference to assemblySystem.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' (CS0012) (Tesserae)

Do you know what this could be? (I will roll back to pre-pull request just to be safe).

marshallward commented 7 years ago

(Also I cocked up the revert a bit, so this may be need to be re-submitted)

ShawnCowles commented 7 years ago

Strange, nothing in that second commit references any new libraries. Any chance that it's something in the project you're using to test?

marshallward commented 7 years ago

Yeah that's a strong possibility. I'll try to work out if it's something on my end.

LaylBongers commented 7 years ago

Given that this change alters no references, the issue can't be caused by it.

marshallward commented 7 years ago

I agree this is almost certainly on my end, I'm just looking through it now.