48 return (
it !=
m_specs.end()) ? &
it->second :
nullptr;
53 std::vector<std::string>
ids;
56 ids.push_back(
kv.first);
62 std::vector<TaskSpec> result;
65 if (
kv.second.category == category)
66 result.push_back(
kv.second);
68 std::sort(result.begin(), result.end(),
70 return a.displayName < b.displayName;
77 std::vector<std::string>
cats;
80 const std::string&
cat =
kv.second.category;
82 for (
size_t i = 0;
i <
cats.size(); ++
i)
96 std::vector<TaskSpec> result;
99 result.push_back(
kv.second);
101 std::sort(result.begin(), result.end(),
103 if (a.category != b.category)
104 return a.category < b.category;
105 return a.displayName < b.displayName;
118 TaskSpec spec{
"move_to_goal",
"Move To Goal",
"Movement",
119 "Move the agent toward its current goal position."};
121 {
"targetKey",
"String",
"TargetPosition",
"Variable key for the target position"},
122 {
"speed",
"Float",
"3.5",
"Movement speed"}
128 TaskSpec spec{
"rotate_to_face",
"Rotate To Face",
"Movement",
129 "Rotate the agent to face a target entity or position."};
131 {
"targetKey",
"String",
"TargetActor",
"Variable key for the target"},
132 {
"rotationSpeed",
"Float",
"180.0",
"Rotation speed in degrees per second"}
139 "Walk along a predefined patrol waypoint path."};
141 {
"pathName",
"String",
"",
"Name of the patrol path to follow"},
142 {
"speed",
"Float",
"2.0",
"Patrol movement speed"}
149 TaskSpec spec{
"attack_if_close",
"Attack If Close",
"Combat",
150 "Perform a melee or ranged attack if the target is within range."};
152 {
"targetKey",
"String",
"TargetActor",
"Variable key for the target"},
153 {
"range",
"Float",
"5.0",
"Attack range"},
154 {
"damage",
"Float",
"10.0",
"Damage value"}
160 TaskSpec spec{
"perform_dodge",
"Perform Dodge",
"Combat",
161 "Execute an evasive dodge maneuver."};
163 {
"dodgeDistance",
"Float",
"2.0",
"Distance to dodge"},
164 {
"dodgeSpeed",
"Float",
"8.0",
"Speed of dodge movement"}
171 "Move the agent to the nearest available cover position."};
173 {
"searchRadius",
"Float",
"20.0",
"Search radius for cover positions"},
174 {
"moveSpeed",
"Float",
"5.0",
"Speed to move to cover"}
181 TaskSpec spec{
"play_animation",
"Play Animation",
"Animation",
182 "Start playing a named animation clip."};
184 {
"animationName",
"String",
"",
"Name of the animation to play"},
185 {
"speed",
"Float",
"1.0",
"Animation playback speed"},
186 {
"loop",
"Bool",
"false",
"Whether to loop the animation"}
192 TaskSpec spec{
"stop_animation",
"Stop Animation",
"Animation",
193 "Stop the currently playing animation."};
195 {
"fadeOutTime",
"Float",
"0.5",
"Time to fade out the animation"}
201 TaskSpec spec{
"blend_animation",
"Blend Animation",
"Animation",
202 "Blend between two animation clips by a weight parameter."};
204 {
"animationNameA",
"String",
"",
"First animation name"},
205 {
"animationNameB",
"String",
"",
"Second animation name"},
206 {
"blendWeight",
"Float",
"0.5",
"Blend weight (0.0 = A, 1.0 = B)"}
214 "Play a sound effect or music track by name."};
216 {
"soundName",
"String",
"",
"Name of the sound to play"},
217 {
"volume",
"Float",
"1.0",
"Volume (0.0 to 1.0)"},
218 {
"loop",
"Bool",
"false",
"Whether to loop the sound"}
225 "Stop a currently playing sound."};
227 {
"soundName",
"String",
"",
"Name of the sound to stop"},
228 {
"fadeOutTime",
"Float",
"0.5",
"Time to fade out"}
235 "Set the volume for a sound channel."};
237 {
"channelName",
"String",
"",
"Name of the audio channel"},
238 {
"volume",
"Float",
"1.0",
"Volume level (0.0 to 1.0)"}
246 "Write a diagnostic message to the system log."};
248 {
"message",
"String",
"Debug message here",
"The message to log"}
255 "Set a named state variable on the agent."};
257 {
"stateName",
"String",
"",
"Name of the state variable"},
258 {
"stateValue",
"String",
"",
"Value to set"}
265 "Clear the agent's current target reference."};
UI-side registry of available atomic tasks with display metadata.
ComponentTypeID GetComponentTypeID_Static()
Singleton registry mapping task IDs to TaskSpec metadata.
void InitializeBuiltInTasks()
std::vector< TaskSpec > GetTasksByCategory(const std::string &category) const
Returns all tasks belonging to the given category.
static AtomicTaskUIRegistry & Get()
Returns the singleton instance.
std::vector< std::string > GetAllTaskIds() const
Returns all registered task IDs (unordered).
std::vector< TaskSpec > GetSortedForUI() const
Returns all tasks sorted by category then displayName, suitable for building a dropdown or combo box.
std::unordered_map< std::string, TaskSpec > m_specs
const TaskSpec * GetTaskSpec(const std::string &id) const
Returns the TaskSpec for the given id, or nullptr if not found.
void Register(const TaskSpec &spec)
Registers a TaskSpec for the given task ID.
std::vector< std::string > GetAllCategories() const
Returns all unique category names.
< Provides AssetID and INVALID_ASSET_ID
Display metadata for a single atomic task type.
std::vector< TaskParameter > parameters
Parameters this task accepts.