13#include "../system/system_utils.h"
65 auto addCF = [
this](
const std::string& type,
const std::string&
display) {
74 addCF(
"Sequence",
"Sequence");
75 addCF(
"Selector",
"Selector");
76 addCF(
"Branch",
"Branch");
77 addCF(
"EntryPoint",
"Entry Point");
78 addCF(
"SubGraph",
"Sub Graph");
79 addCF(
"Repeat",
"Repeat");
80 addCF(
"Wait",
"Wait");
83 auto addAction = [
this](
const std::string& type,
const std::string&
display) {
92 addAction(
"MoveToLocation",
"Move To Location");
100 auto addData = [
this](
const std::string& type,
const std::string&
display) {
109 addData(
"GetVariable",
"Get Variable");
110 addData(
"SetBlackboardKey",
"Set Blackboard Key");
112 SYSTEM_LOG <<
"[NodeSearchPalette] Catalog initialised with "
122 const std::string&
query,
125 std::vector<NodeSearchResult>
results;
160 if (a.score != b.score)
161 return a.score > b.score;
162 return a.displayName < b.displayName;
175 for (
size_t i = 0;
i <
out.size(); ++
i)
176 out[
i] =
static_cast<char>(std::tolower(
static_cast<unsigned char>(
out[
i])));
197 if (
c.substr(0,
q.size()) ==
q)
201 if (
c.find(
q) != std::string::npos)
210 while (
qi <
q.size() &&
ci <
c.size())
226 int score = 400 -
gaps * 5;
227 return (score > 1) ? score : 1;
ComponentTypeID GetComponentTypeID_Static()
Fuzzy-search palette for VS node types (Phase 7).
Singleton fuzzy-search palette for VS node types.
std::vector< NodeSearchResult > m_NodeCatalog
static int ComputeFuzzyScore(const std::string &query, const std::string &candidate)
Computes a fuzzy match score between query and candidate.
std::vector< NodeSearchResult > FuzzySearch(const std::string &query, NodeSearchCategory filter=NodeSearchCategory::All)
Fuzzy-searches the node catalog.
static NodeSearchPalette & Get()
Returns the single shared instance.
const std::vector< NodeSearchResult > & GetAllNodes() const
Returns all node types in the catalog (unfiltered).
< Provides AssetID and INVALID_ASSET_ID
NodeSearchCategory
Broad category for filtering node search results.
static std::string ToLower(const std::string &s)
A single match returned by NodeSearchPalette::FuzzySearch().
std::string typeName
Internal type identifier (e.g. "Sequence")
int score
Fuzzy match score; higher = better.