Table of Contents

Interface IPluginLootClassifierRegistry

Namespace
AcDream.Plugin.Abstractions
Assembly
AcDream.Plugin.Abstractions.dll

The client-wide directory of loot classifiers: one plugin publishes its rules here and any other plugin can ask them for verdicts by id. Every call reports false rather than throwing when the id is not registered, and also when the classifier itself throws.

public interface IPluginLootClassifierRegistry

Properties

Available

Every classifier registered right now, ordered by display name. Empty when none are.

IReadOnlyList<PluginLootClassifierInfo> Available { get; }

Property Value

IReadOnlyList<PluginLootClassifierInfo>

Methods

Register(string, string, IPluginLootClassifier)

Publishes a classifier under an id of your choosing, which the host scopes by your plugin id before anyone else sees it. Dispose the returned handle to withdraw it. Throws if that id is already taken, or if this host does not support classifiers at all.

IDisposable Register(string classifierId, string displayName, IPluginLootClassifier classifier)

Parameters

classifierId string
displayName string
classifier IPluginLootClassifier

Returns

IDisposable

TryClassify(string, in PluginLootClassificationContext, out PluginLootClassification)

Asks a registered classifier to judge one item. Returns false when no classifier is registered under that id, or when it threw.

bool TryClassify(string classifierId, in PluginLootClassificationContext context, out PluginLootClassification classification)

Parameters

classifierId string
context PluginLootClassificationContext
classification PluginLootClassification

Returns

bool

TryClassifyWithProfile(string, string, in PluginLootClassificationContext, out PluginLootClassification)

bool TryClassifyWithProfile(string classifierId, string profileName, in PluginLootClassificationContext context, out PluginLootClassification classification)

Parameters

classifierId string
profileName string
context PluginLootClassificationContext
classification PluginLootClassification

Returns

bool

TryNeedsIdentification(string, in PluginLootClassificationContext)

Forwards to the registered classifier's NeedsIdentification(in PluginLootClassificationContext).

bool TryNeedsIdentification(string classifierId, in PluginLootClassificationContext context)

Parameters

classifierId string
context PluginLootClassificationContext

Returns

bool

TryNotifyItemRemoved(string, uint)

Forwards to the registered classifier's OnItemRemoved(uint). Returns false when no classifier is registered under that id, or when it threw.

bool TryNotifyItemRemoved(string classifierId, uint objectId)

Parameters

classifierId string
objectId uint

Returns

bool

TryNotifyLooted(string, in PluginLootedItem)

Forwards to the registered classifier's OnLooted(in PluginLootedItem). Returns false when no classifier is registered under that id, or when it threw.

bool TryNotifyLooted(string classifierId, in PluginLootedItem item)

Parameters

classifierId string
item PluginLootedItem

Returns

bool