YarnSaliencyStrategy
Base class for saliency selection strategies.
class_name YarnSaliencyStrategy
extends RefCountedInherits from RefCounted
#Nested Types
- ContentType enum
- Returns the best of the least-recently viewed items.
- YarnBestSaliencyStrategy classReturns the highest-complexity non-failing item.
- Always returns the first non-failing item.
- Returns a random choice from the best of the least-recently viewed items. This is the default strategy.
- Returns a random non-failing item. GDScript-only convenience strategy.
#Constants
#VIEW_COUNT_KEY_PREFIX
const VIEW_COUNT_KEY_PREFIX = "$Yarn.Internal.Content.ViewCount."#Methods
#filter_valid_candidates(Array[Dictionary])
static func filter_valid_candidates(candidates: Array[Dictionary]) -> Array[Dictionary]Parameters
candidatesArray[Dictionary]
Returns Array[Dictionary]
#get_candidate_index(Array[Dictionary], Dictionary)
static func get_candidate_index(candidates: Array[Dictionary], candidate: Dictionary) -> intParameters
candidatesArray[Dictionary]candidateDictionary
Returns int
#get_view_count_key(String)
static func get_view_count_key(content_id: String) -> StringParameters
content_idString
Returns String
#get_view_count(Dictionary, String)
static func get_view_count(context: Dictionary, content_id: String) -> intParameters
contextDictionarycontent_idString
Returns int
#increment_view_count(Dictionary, Dictionary)
static func increment_view_count(context: Dictionary, candidate: Dictionary) -> voidParameters
contextDictionarycandidateDictionary
#on_candidate_selected(Dictionary, Dictionary)
func on_candidate_selected(candidate: Dictionary, context: Dictionary) -> voidParameters
candidateDictionarycontextDictionary
#select_candidate(Array[Dictionary], Dictionary)
Returns the selected candidate index, or -1 if none selected.
func select_candidate(candidates: Array[Dictionary], context: Dictionary) -> intParameters
candidatesArray[Dictionary]contextDictionary
Returns int
#valid_candidate_indices(Array[Dictionary])
static func valid_candidate_indices(candidates: Array[Dictionary]) -> PackedInt32ArrayParameters
candidatesArray[Dictionary]
Returns PackedInt32Array
Generated from Yarn Spinner for Godot GDScript 3.3.