Table of Contents

Class ItemTemplateService

Namespace
Moongate.UO.Data.Services.Templates
Assembly
Moongate.UO.Data.dll
public sealed class ItemTemplateService : IItemTemplateService
Inheritance
ItemTemplateService
Implements
Inherited Members

Properties

Count

Gets the number of templates currently registered.

public int Count { get; }

Property Value

int

Methods

Clear()

Removes all registered templates.

public void Clear()

GetAll()

Returns all templates as a snapshot.

public IReadOnlyList<ItemTemplateDefinition> GetAll()

Returns

IReadOnlyList<ItemTemplateDefinition>

List of currently registered templates.

TryGet(string, out ItemTemplateDefinition?)

Tries to get a template by id.

public bool TryGet(string id, out ItemTemplateDefinition? definition)

Parameters

id string

Template id.

definition ItemTemplateDefinition

Resolved template when present.

Returns

bool

true when found; otherwise false.

Upsert(ItemTemplateDefinition)

Adds or replaces a template by identifier.

public void Upsert(ItemTemplateDefinition definition)

Parameters

definition ItemTemplateDefinition

Template instance to register.

UpsertRange(IEnumerable<ItemTemplateDefinition>)

Adds or replaces multiple templates.

public void UpsertRange(IEnumerable<ItemTemplateDefinition> templates)

Parameters

templates IEnumerable<ItemTemplateDefinition>

Templates to register.