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
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
classifierIdstringdisplayNamestringclassifierIPluginLootClassifier
Returns
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
classifierIdstringcontextPluginLootClassificationContextclassificationPluginLootClassification
Returns
TryClassifyWithProfile(string, string, in PluginLootClassificationContext, out PluginLootClassification)
Forwards to the registered classifier's TryClassifyWithProfile(string, in PluginLootClassificationContext, out PluginLootClassification).
bool TryClassifyWithProfile(string classifierId, string profileName, in PluginLootClassificationContext context, out PluginLootClassification classification)
Parameters
classifierIdstringprofileNamestringcontextPluginLootClassificationContextclassificationPluginLootClassification
Returns
TryNeedsIdentification(string, in PluginLootClassificationContext)
Forwards to the registered classifier's NeedsIdentification(in PluginLootClassificationContext).
bool TryNeedsIdentification(string classifierId, in PluginLootClassificationContext context)
Parameters
classifierIdstringcontextPluginLootClassificationContext
Returns
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
Returns
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
classifierIdstringitemPluginLootedItem