GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Define a type for parameters of a function (action, condition or expression) or the returned value of an expression. More...
#include <ValueTypeMetadata.h>
Public Member Functions | |
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 number. More... | |
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). | |
Serialization | |
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. | |
Static Public Member Functions | |
static bool | IsTypeLegacyPreScopedVariable (const gd::String &type) |
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). | |
static bool | IsTypeObject (const gd::String ¶meterType) |
Return true if the type is representing one object (or more, i.e: an object group). | |
static bool | IsTypeBehavior (const gd::String ¶meterType) |
Return true if the type is "behavior". | |
static bool | IsTypeExpression (const gd::String &type, const gd::String ¶meterType) |
Return true if the type is an expression of the given type. More... | |
static const gd::String & | GetExpressionPrimitiveValueType (const gd::String ¶meterType) |
Return the expression type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string". More... | |
static const gd::String & | GetPrimitiveValueType (const gd::String ¶meterType) |
Return the primitive type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string". More... | |
static const gd::String & | ConvertPropertyTypeToValueType (const gd::String &propertyType) |
Return the ValueTypeMetadata name for a property type. More... | |
Static Public Attributes | |
static const gd::String | numberType = "number" |
static const gd::String | stringType = "string" |
static const gd::String | variableType = "variable" |
static const gd::String | booleanType = "boolean" |
Define a type for parameters of a function (action, condition or expression) or the returned value of an expression.
|
static |
Return the ValueTypeMetadata name for a property type.
|
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".
|
static |
Return the primitive type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string".
|
inlinestatic |
Return true if the type is an expression of the given type.
|
inline |
Return true if the type of the parameter is a number.