48 return (
it !=
m_specs.end()) ? &
it->second :
nullptr;
53 std::vector<std::string>
ids;
56 ids.push_back(
kv.first);
57 std::sort(
ids.begin(),
ids.end());
63 std::vector<ConditionSpec> result;
66 result.push_back(
kv.second);
67 std::sort(result.begin(), result.end(),
84 spec.displayName =
"Compare Value";
85 spec.description =
"Compare a blackboard variable against a literal value.";
87 "Blackboard key to read",
true});
89 "Comparison operator (==, !=, <, <=, >, >=)",
true});
91 "Literal value to compare against",
true});
99 spec.displayName =
"Is Set";
100 spec.description =
"True if the blackboard key has been assigned a value.";
102 "Blackboard key to check",
true});
110 spec.displayName =
"Is Not Set";
111 spec.description =
"True if the blackboard key has not been assigned a value.";
113 "Blackboard key to check",
true});
121 spec.displayName =
"In Range";
122 spec.description =
"True if a blackboard value is within [Min, Max].";
124 "Blackboard key to read",
true});
126 "Minimum value (inclusive)",
true});
128 "Maximum value (inclusive)",
true});
136 spec.displayName =
"Random Chance";
137 spec.description =
"True with a given probability [0.0 .. 1.0].";
139 "Probability of returning true (0.0 to 1.0)",
true});
Registry of available condition types for Branch/While node dropdowns.
ComponentTypeID GetComponentTypeID_Static()
Singleton registry of available condition types.
void Register(const ConditionSpec &spec)
Registers a ConditionSpec.
static ConditionRegistry & Get()
Returns the singleton instance.
std::vector< ConditionSpec > GetAllConditions() const
Returns all registered condition specs, sorted by id.
std::vector< std::string > GetAllConditionIds() const
Returns all registered condition IDs.
const ConditionSpec * GetConditionSpec(const std::string &id) const
Returns the ConditionSpec for the given id, or nullptr if not found.
std::unordered_map< std::string, ConditionSpec > m_specs
void InitializeBuiltInConditions()
< Provides AssetID and INVALID_ASSET_ID
@ LocalVariable
Value is read from the local blackboard at runtime.
@ Literal
Value is embedded directly in the template.
@ ComparisonOp
Comparison operator (==, !=, <, <=, >, >=) (from OperatorRegistry)
Full metadata for a single condition type.
std::string id
Condition type ID (e.g. "CompareValue")