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
resourceReader
IResourceReaderA reader that is able to read Tiled resources from a given path.
resourceCache
IResourceCacheA cache that stores Tiled resources for faster retrieval and reuse.
customTypeDefinitions
IEnumerable<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
resourceReader
IResourceReaderA reader that is able to read Tiled resources from a given path.
resourceCache
IResourceCacheA cache that stores Tiled resources for faster retrieval and reuse.
customTypeDefinitions
IEnumerable<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
mapPath
stringThe 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
tilesetPath
stringThe path to the tileset file.
Returns
- Tileset
The loaded tileset.