Class Loader
- Namespace
- DotTiled.Serialization
- Assembly
- DotTiled.dll
Able to load Tiled resources from a given path.
public class Loader
- Inheritance
-
Loader
- Inherited Members
Constructors
Loader(IResourceReader, IResourceCache, IEnumerable<ICustomTypeDefinition>)
Initializes a new instance of the Loader class with the given resourceReader, resourceCache, and customTypeDefinitions.
public Loader(IResourceReader resourceReader, IResourceCache resourceCache, IEnumerable<ICustomTypeDefinition> customTypeDefinitions)
Parameters
resourceReaderIResourceReaderA reader that is able to read Tiled resources from a given path.
resourceCacheIResourceCacheA cache that stores Tiled resources for faster retrieval and reuse.
customTypeDefinitionsIEnumerable<ICustomTypeDefinition>A collection of custom type definitions that can be used to resolve custom types in Tiled resources.
Methods
Default()
Creates a new instance of a Loader with the default FileSystemResourceReader and DefaultResourceCache, and no available custom type definitions.
public static Loader Default()
Returns
DefaultWith(IResourceReader, IResourceCache, IEnumerable<ICustomTypeDefinition>)
Creates a new instance of a Loader with the ability to override the default FileSystemResourceReader, DefaultResourceCache, and custom type definitions.
public static Loader DefaultWith(IResourceReader resourceReader = null, IResourceCache resourceCache = null, IEnumerable<ICustomTypeDefinition> customTypeDefinitions = null)
Parameters
resourceReaderIResourceReaderA reader that is able to read Tiled resources from a given path.
resourceCacheIResourceCacheA cache that stores Tiled resources for faster retrieval and reuse.
customTypeDefinitionsIEnumerable<ICustomTypeDefinition>A collection of custom type definitions that can be used to resolve custom types in Tiled resources.
Returns
LoadMap(string)
Loads a map from the given mapPath.
public Map LoadMap(string mapPath)
Parameters
mapPathstringThe path to the map file.
Returns
- Map
The loaded map.
LoadTileset(string)
Loads a tileset from the given tilesetPath.
public Tileset LoadTileset(string tilesetPath)
Parameters
tilesetPathstringThe path to the tileset file.
Returns
- Tileset
The loaded tileset.