All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

ContentWasSelected(ContentSaliencyOption)

Method in

Called by Yarn Spinner to indicate that a piece of salient content has been selected, and this system should update any state related to how it selects content.

If a content saliency strategy does not need to keep track of any state, then this method can be empty.

Name
Description
public void ContentWasSelected(ContentSaliencyOption content)

content

The content that has been selected.

Summary

Remarks

Parameters

FirstSaliencyStrategy
Yarn.Saliency.ContentSaliencyOption

FirstSaliencyStrategy

Class in Yarn.Saliency

Inherits from System.Object

Summary

A content saliency strategy that always returns the first non-failing item in the list of available options.

public class FirstSaliencyStrategy : IContentSaliencyStrategy

Remarks

This saliency strategy is used when a Dialogue has no provided saliency strategy, but is required to make a decision.

Methods

Name
Description

Called by Yarn Spinner to indicate that a piece of salient content has been selected, and this system should update any state related to how it selects content.

Chooses an item from content that is the most appropriate (or salient ) for the user's current context.

ContentWasSelected(ContentSaliencyOption)
QueryBestContent(IEnumerable)

QueryBestContent(IEnumerable<ContentSaliencyOption>)

Method in FirstSaliencyStrategy

Summary

Chooses an item from content that is the most appropriate (or salient ) for the user's current context.

public ContentSaliencyOption? QueryBestContent(IEnumerable<ContentSaliencyOption> content)

Remarks

Implementations of this method should not modify any state

  • that is, they should be 'read-only' operations. If a strategy needs to record information about when a piece of content has been selected, it should do it in the ContentWasSelected(ContentSaliencyOption) method.

Parameters

Name
Description

An item from content that is the most appropriate for display, or null if no content should be displayed.

System.Collections.Generic.IEnumerable<Yarn.Saliency.ContentSaliencyOption> content

A collection of content items. This collection may be empty.

Returns