Table of Contents

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 IResourceReader

A reader that is able to read Tiled resources from a given path.

resourceCache IResourceCache

A 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

Loader

A new instance of a Loader.

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 IResourceReader

A reader that is able to read Tiled resources from a given path.

resourceCache IResourceCache

A 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

Loader

LoadMap(string)

Loads a map from the given mapPath.

public Map LoadMap(string mapPath)

Parameters

mapPath string

The 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 string

The path to the tileset file.

Returns

Tileset

The loaded tileset.