Define a type for parameters of a function (action, condition or expression) or the returned value of an expression.
More...
#include <ValueTypeMetadata.h>
|
const gd::String & | GetName () const |
| Return the string representation of the type.
|
|
ValueTypeMetadata & | SetName (const gd::String &name_) |
| Set the string representation of the type.
|
|
const gd::String & | GetExtraInfo () const |
| Return an optional additional information, used for some parameters with special type (for example, it can contains the type of object accepted by the parameter).
|
|
ValueTypeMetadata & | SetExtraInfo (const gd::String &supplementaryInformation_) |
| Set an optional additional information, used for some parameters with special type (for example, it can contains the type of object accepted by the parameter).
|
|
bool | IsOptional () const |
| Return true if the parameter is optional.
|
|
ValueTypeMetadata & | SetOptional (bool optional_=true) |
| Set if the parameter is optional.
|
|
const gd::String & | GetDefaultValue () const |
| Get the default value for the parameter.
|
|
ValueTypeMetadata & | SetDefaultValue (const gd::String &defaultValue_) |
| Set the default value, if the parameter is optional.
|
|
bool | IsDefined () const |
| Return true if the type is defined.
|
|
bool | IsObject () const |
| Return true if the type is representing one object (or more, i.e: an object group).
|
|
bool | IsBehavior () const |
| Return true if the type is "behavior".
|
|
bool | IsNumber () const |
| Return true if the type is an expression of the given type.
|
|
bool | IsString () const |
| Return true if the type is a string.
|
|
bool | IsBoolean () const |
| Return true if the type is a boolean.
|
|
bool | IsVariable () const |
| Return true if the type of the parameter is a variable. More...
|
|
bool | IsVariableOnly () const |
| Return true if the type of the parameter is a variable and not a property or a parameter.
|
|
bool | IsLegacyPreScopedVariable () const |
| Return true if the type is a variable but from a specific scope (scene, project or object). In new code, prefer to use the more generic "variable" parameter (which accepts any variable coming from an object or from containers in the scope).
|
|
|
void | SerializeTo (gd::SerializerElement &element) const |
| Serialize the ParameterMetadata to the specified element.
|
|
void | UnserializeFrom (const gd::SerializerElement &element) |
| Load the ParameterMetadata from the specified element.
|
|
Define a type for parameters of a function (action, condition or expression) or the returned value of an expression.
- See also
- gd::EventsFunction
◆ ConvertPropertyTypeToValueType()
const gd::String & gd::ValueTypeMetadata::ConvertPropertyTypeToValueType |
( |
const gd::String & |
propertyType | ) |
|
|
static |
◆ GetExpressionPrimitiveValueType()
const gd::String & gd::ValueTypeMetadata::GetExpressionPrimitiveValueType |
( |
const gd::String & |
parameterType | ) |
|
|
static |
Return the expression type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string".
- Note
- It only maps string and number types.
◆ GetPrimitiveValueType()
Return the primitive type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string".
- Note
- It also maps variable and boolean types.
◆ IsTypeExpression()
static bool gd::ValueTypeMetadata::IsTypeExpression |
( |
const gd::String & |
type, |
|
|
const gd::String & |
parameterType |
|
) |
| |
|
inlinestatic |
Return true if the type is an expression of the given type from the caller point of view.
- Note
- If you are adding a new type of parameter, also add it in the IDE ( see EventsFunctionParametersEditor, ParameterRenderingService and ExpressionAutocompletion) and in the EventsCodeGenerator.
◆ IsVariable() [1/2]
bool gd::ValueTypeMetadata::IsVariable |
( |
| ) |
const |
|
inline |
Return true if the type of the parameter is a variable.
- Note
- If you had a new type of parameter, also add it in the IDE ( see EventsFunctionParametersEditor, ParameterRenderingService and ExpressionAutocompletion) and in the EventsCodeGenerator.
◆ IsVariable() [2/2]
static bool gd::ValueTypeMetadata::IsVariable |
( |
const gd::String & |
type | ) |
|
|
inlinestatic |
Return true if the type of the parameter is a variable.
- Note
- If you had a new type of parameter, also add it in the IDE ( see EventsFunctionParametersEditor, ParameterRenderingService and ExpressionAutocompletion) and in the EventsCodeGenerator.
The documentation for this class was generated from the following files: