Table of Contents

Class DefaultResourceCache

Namespace
DotTiled.Serialization
Assembly
DotTiled.dll

A default implementation of IResourceCache that uses an in-memory dictionary to cache resources.

public class DefaultResourceCache : IResourceCache
Inheritance
DefaultResourceCache
Implements
Inherited Members

Methods

GetTemplate(string)

Retrieves a template from the cache with the given path.

public Optional<Template> GetTemplate(string path)

Parameters

path string

The path to the template file.

Returns

Optional<Template>

The template if it exists in the cache; otherwise, Empty.

GetTileset(string)

Retrieves a tileset from the cache with the given path.

public Optional<Tileset> GetTileset(string path)

Parameters

path string

The path to the tileset file.

Returns

Optional<Tileset>

The tileset if it exists in the cache; otherwise, Empty.

InsertTemplate(string, Template)

Inserts a template into the cache with the given path.

public void InsertTemplate(string path, Template template)

Parameters

path string

The path to the template file.

template Template

The template to insert into the cache.

InsertTileset(string, Tileset)

Inserts a tileset into the cache with the given path.

public void InsertTileset(string path, Tileset tileset)

Parameters

path string

The path to the tileset file.

tileset Tileset

The tileset to insert into the cache.