14#include "../system/system_utils.h"
86 throw std::runtime_error(
"[TaskValue] Type mismatch: expected Bool");
95 throw std::runtime_error(
"[TaskValue] Type mismatch: expected Int");
104 throw std::runtime_error(
"[TaskValue] Type mismatch: expected Float");
113 throw std::runtime_error(
"[TaskValue] Type mismatch: expected Vector");
122 throw std::runtime_error(
"[TaskValue] Type mismatch: expected EntityID");
131 throw std::runtime_error(
"[TaskValue] Type mismatch: expected String");
164 std::ostringstream
oss;
174 SYSTEM_LOG <<
"[TaskValue] WARNING: to_string() called on None/unknown type, returning '0'\n";
198 SYSTEM_LOG <<
"[VariableTypeToString] ERROR: Unknown type, defaulting to Int\n";
214 default:
return TaskValue(0);
ComponentTypeID GetComponentTypeID_Static()
Core enumerations and TaskValue type-safe variant for the Atomic Task System.
std::string to_string() const
Converts the stored value to a string representation.
int AsInt() const
Returns the int value.
::Vector AsVector() const
Returns the Vector value.
EntityID AsEntityID() const
Returns the EntityID value.
float AsFloat() const
Returns the float value.
std::string m_stringValue
bool IsNone() const
Returns true if the value has not been set (type == None).
std::string AsString() const
Returns the string value.
bool AsBool() const
Returns the bool value.
TaskValue()
Default constructor: creates a value of type VariableType::None.
VariableType GetType() const
Returns the VariableType tag of the stored value.
union Olympe::TaskValue::PodData m_data
< Provides AssetID and INVALID_ASSET_ID
VariableType
Type tags used by TaskValue to identify stored data.
@ Int
32-bit signed integer
@ Float
Single-precision float.
@ GlobalRef
Reference to a global blackboard key (scope "global:")
@ List
std::vector<TaskValue> (used by ForEach node)
@ Vector
3-component vector (Vector from vector.h)
@ None
Uninitialized / empty value.
@ EntityID
Entity identifier (uint64_t)
static std::string VariableTypeToString(VariableType type)
Converts a VariableType to its canonical string representation.
static TaskValue GetDefaultValueForType(VariableType type)
Returns a correctly-typed default TaskValue for the given VariableType.