<commit_before>TiledSharp
==========
A .NET C# library for importing Tiled TMX tile maps


About TiledSharp
----------------
TiledSharp is a .NET C# library for importing TMX_ tilemaps and TSX tilesets
generated by Tiled_, a tile map generation tool. The data is saved as a TmxMap_
object, whose structure closely resembles the original TMX file.

As a generic TMX and TSX parser, TiledSharp does not render the maps or depend
on any external framework beyond .NET, such as XNA Game Studio, MonoGame, or
the Playstation Mobile SDK. However, it can be used as an interface between TMX
data and external games.

For an example of a TSX Map renderer, see my Tesserae_ project.


Usage
-----
To import a TMX file into your C# application:

- Include a reference to TiledSharp. You can either incorporare it directory
  into your own project, or you can pre-compile it and include the DLL.

- Import the TiledSharp namespace (optional):

.. code:: csharp

    using TiledSharp;

- Create a Map object using the constructor::

    var map = new TmxMap("someMap.tmx");

  TiledSharp supports both resource names and file paths, and should work as
  expected in most situations. For more details, please consult the wiki.

- Access the TMX data using the Map fields. Principal classes can be accessed
  by either name or index::

    var map = new TmxMap("someMap.tmx");
    var version = map.Version;
    var myTileset = map.Tilesets["myTileset"];
    var myLayer = map.Layers[2];
    var hiddenChest = map.ObjectGroups["Chests"].Objects["hiddenChest"];

Map data fields correspond closely to the TMX file structure. For a complete
listing, see the `TiledSharp Data Hierarchy`_.

Although TiledSharp can manage elements with the same name, it is not
recommended. For more information, see the TmxList_ specification.


Tiled 0.9.0 Status Report
-------------------------
To the best of my knowledge, all new 0.9.0 features have been implemented:

* Map: backgroundcolor
* Imagelayer
* Object: visible, rotation
* Ellipse
* Tileset: TileOffset
* Tileset: Terraintype, Terrain
* Image: format and data (base64 embedded image) *(completely untested)*

I am still in the process of testing most of these new features.

The following new T# features have been added or changed:

* TmxList elements now return their type, rather than their interface
* TmxObject.Width and Height are no longer nullable
* Colors are now stored under a platform-neutral TmxColor class

The following new T# features may need to be added or redesigned:

* Tileset.Tile: Current dictionary key is tile id. Maybe that is dumb.
* TmxData object; generalization of data decoding to TmxLayer and TmxImage
* cleaner ToString field output
* Develop test cases and automated testing
* Add a "ReadXmlAttribute" function that resolves default cases


Notes
-----
TiledSharp parses XML files produced by Tiled_, an open-source (GPL) tile map
editor developed and maintained by <NAME>.

Zlib decompression in TiledSharp uses the Zlib implementation of DotNetZip_
v1.9.1.8.


Licensing
---------
TiledSharp_ is distributed under the `Apache 2.0 License`_.

Support code from DotNetZip_ is distributed under the `Microsoft Public
License`_.


Contact
-------
<NAME> <<EMAIL>>

.. _TMX: https://github.com/bjorn/tiled/wiki/TMX-Map-Format
.. _Tiled: http://mapeditor.org
.. _TmxMap: https://github.com/marshallward/TiledSharp/wiki/TmxMap
.. _TiledSharp: https://github.com/marshallward/TiledSharp
.. _TiledSharp Data Hierarchy:
    https://github.com/marshallward/TiledSharp/wiki/TiledSharp-Data-Hierarchy
.. _TmxList: https://github.com/marshallward/TiledSharp/wiki/TmxList
.. _DotNetZip: http://dotnetzip.codeplex.com
.. _Apache 2.0 License:
    http://www.apache.org/licenses/LICENSE-2.0.txt
.. _Microsoft Public License:
    http://www.microsoft.com/en-us/openness/licenses.aspx#MPL<commit_msg>README update; C# syntax<commit_after>TiledSharp
==========
A .NET C# library for importing Tiled TMX tile maps


About TiledSharp
----------------
TiledSharp is a .NET C# library for importing TMX_ tilemaps and TSX tilesets
generated by Tiled_, a tile map generation tool. The data is saved as a TmxMap_
object, whose structure closely resembles the original TMX file.

As a generic TMX and TSX parser, TiledSharp does not render the maps or depend
on any external framework beyond .NET, such as XNA Game Studio, MonoGame, or
the Playstation Mobile SDK. However, it can be used as an interface between TMX
data and external games.

For an example of a TSX Map renderer, see my Tesserae_ project.


Usage
-----
To import a TMX file into your C# application:

- Include a reference to TiledSharp. You can either incorporare it directory
  into your own project, or you can pre-compile it and include the DLL.

- Import the TiledSharp namespace (optional):

  .. code:: csharp

     using TiledSharp;

- Create a Map object using the constructor:

  .. code:: csharp

     var map = new TmxMap("someMap.tmx");

  TiledSharp supports both resource names and file paths, and should work as
  expected in most situations. For more details, please consult the wiki.

- Access the TMX data using the Map fields. Principal classes can be accessed
  by either name or index:

  .. code:: csharp

     var map = new TmxMap("someMap.tmx");
     var version = map.Version;
     var myTileset = map.Tilesets["myTileset"];
     var myLayer = map.Layers[2];
     var hiddenChest = map.ObjectGroups["Chests"].Objects["hiddenChest"];

Map data fields correspond closely to the TMX file structure. For a complete
listing, see the `TiledSharp Data Hierarchy`_.

Although TiledSharp can manage elements with the same name, it is not
recommended. For more information, see the TmxList_ specification.


Tiled 0.9.0 Status Report
-------------------------
To the best of my knowledge, all new 0.9.0 features have been implemented:

* Map: backgroundcolor
* Imagelayer
* Object: visible, rotation
* Ellipse
* Tileset: TileOffset
* Tileset: Terraintype, Terrain
* Image: format and data (base64 embedded image) *(completely untested)*

I am still in the process of testing most of these new features.

The following new T# features have been added or changed:

* TmxList elements now return their type, rather than their interface
* TmxObject.Width and Height are no longer nullable
* Colors are now stored under a platform-neutral TmxColor class

The following new T# features may need to be added or redesigned:

* Tileset.Tile: Current dictionary key is tile id. Maybe that is dumb.
* TmxData object; generalization of data decoding to TmxLayer and TmxImage
* cleaner ToString field output
* Develop test cases and automated testing
* Add a "ReadXmlAttribute" function that resolves default cases


Notes
-----
TiledSharp parses XML files produced by Tiled_, an open-source (GPL) tile map
editor developed and maintained by <NAME>.

Zlib decompression in TiledSharp uses the Zlib implementation of DotNetZip_
v1.9.1.8.


Licensing
---------
TiledSharp_ is distributed under the `Apache 2.0 License`_.

Support code from DotNetZip_ is distributed under the `Microsoft Public
License`_.


Contact
-------
<NAME> <<EMAIL>>

.. _TMX: https://github.com/bjorn/tiled/wiki/TMX-Map-Format
.. _Tiled: http://mapeditor.org
.. _Tesserae: https://github.com/marshallward/Tesserae
.. _TmxMap: https://github.com/marshallward/TiledSharp/wiki/TmxMap
.. _TiledSharp: https://github.com/marshallward/TiledSharp
.. _TiledSharp Data Hierarchy:
    https://github.com/marshallward/TiledSharp/wiki/TiledSharp-Data-Hierarchy
.. _TmxList: https://github.com/marshallward/TiledSharp/wiki/TmxList
.. _DotNetZip: http://dotnetzip.codeplex.com
.. _Apache 2.0 License:
    http://www.apache.org/licenses/LICENSE-2.0.txt
.. _Microsoft Public License:
    http://www.microsoft.com/en-us/openness/licenses.aspx#MPL
{'fraction_non_alphanumeric': 0.09128152605300217, 'fraction_numerical': 0.004864934067340929, 'mean_word_length': 3.8014751075599262, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 11, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6142510', 'n_tokens_mistral': 2392, 'n_tokens_neox': 2240, 'n_words': 954}