GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members

Describe a parameter of an instruction (action, condition) or of an expression: type, user-friendly description, etc... More...

#include <ParameterMetadata.h>

Public Member Functions

ParameterMetadataClone () const
 Return a pointer to a new ParameterMetadata constructed from this one.
 
gd::ValueTypeMetadataGetValueTypeMetadata ()
 Return the metadata of the parameter type.
 
const gd::ValueTypeMetadataGetValueTypeMetadata () const
 Return the metadata of the parameter type.
 
ParameterMetadataSetValueTypeMetadata (const gd::ValueTypeMetadata &valueTypeMetadata_)
 Set the metadata of the parameter type.
 
const gd::StringGetType () const
 Return the type of the parameter. More...
 
ParameterMetadataSetType (const gd::String &type_)
 Set the type of the parameter. More...
 
const gd::StringGetName () const
 Return the name of the parameter. More...
 
ParameterMetadataSetName (const gd::String &name_)
 Set the name of the parameter. More...
 
const gd::StringGetExtraInfo () 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). More...
 
ParameterMetadataSetExtraInfo (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). More...
 
bool IsOptional () const
 Return true if the parameter is optional. More...
 
ParameterMetadataSetOptional (bool optional_=true)
 Set if the parameter is optional. More...
 
const gd::StringGetDescription () const
 Return the description of the parameter.
 
ParameterMetadataSetDescription (const gd::String &description_)
 Set the description of the parameter.
 
bool IsCodeOnly () const
 Return true if the parameter is only meant to be completed during compilation and must not be displayed to the user.
 
ParameterMetadataSetCodeOnly (bool codeOnly_=true)
 Set if the parameter is only meant to be completed during compilation and must not be displayed to the user.
 
const gd::StringGetDefaultValue () const
 Get the default value for the parameter.
 
ParameterMetadataSetDefaultValue (const gd::String &defaultValue_)
 Set the default value, if the parameter is optional.
 
const gd::StringGetLongDescription () const
 Get the user friendly, long description for the parameter.
 
ParameterMetadataSetLongDescription (const gd::String &longDescription_)
 Set the user friendly, long description for the parameter.
 
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 IsObject (const gd::String &parameterType)
 Return true if the type of the parameter is representing one object (or more, i.e: an object group). More...
 
static bool IsBehavior (const gd::String &parameterType)
 Return true if the type of the parameter is "behavior". More...
 
static bool IsExpression (const gd::String &type, const gd::String &parameterType)
 Return true if the type of the parameter is an expression of the given type. More...
 
static const gd::StringGetExpressionValueType (const gd::String &parameterType)
 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...
 

Public Attributes

gd::String description
 Description shown in editor.
 
bool codeOnly
 

Detailed Description

Describe a parameter of an instruction (action, condition) or of an expression: type, user-friendly description, etc...

Member Function Documentation

◆ GetExpressionValueType()

static const gd::String& gd::ParameterMetadata::GetExpressionValueType ( const gd::String parameterType)
inlinestatic

Return the expression type from the parameter type. Declinations of "number" and "string" types (like "forceMultiplier" or "sceneName") are replaced by "number" and "string".

Deprecated:
Use gd::ValueTypeMetadata or gd::GetExpressionPrimitiveValueType instead.

◆ GetExtraInfo()

const gd::String& gd::ParameterMetadata::GetExtraInfo ( ) const
inline

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).

Deprecated:
Use gd::ValueTypeMetadata instead.

◆ GetName()

const gd::String& gd::ParameterMetadata::GetName ( ) const
inline

Return the name of the parameter.

Name is optional, and won't be filled for most parameters of extensions. It is useful when generating a function from events, where parameters must be named.

◆ GetType()

const gd::String& gd::ParameterMetadata::GetType ( ) const
inline

Return the type of the parameter.

See also
gd::ParameterMetadata::IsObject
Deprecated:
Use gd::ValueTypeMetadata instead.

◆ IsBehavior()

static bool gd::ParameterMetadata::IsBehavior ( const gd::String parameterType)
inlinestatic

Return true if the type of the parameter is "behavior".

See also
gd::ParameterMetadata::GetType
Deprecated:
Use gd::ValueTypeMetadata instead.

◆ IsExpression()

static bool gd::ParameterMetadata::IsExpression ( const gd::String type,
const gd::String parameterType 
)
inlinestatic

Return true if the type of the parameter is an expression of the given type.

Note
If you had a new type of parameter, also add it in the IDE ( see EventsFunctionParametersEditor, ParameterRenderingService and ExpressionAutocompletion) and in the EventsCodeGenerator.
Deprecated:
Use gd::ValueTypeMetadata instead.

◆ IsObject()

static bool gd::ParameterMetadata::IsObject ( const gd::String parameterType)
inlinestatic

Return true if the type of the parameter is representing one object (or more, i.e: an object group).

See also
gd::ParameterMetadata::GetType
Deprecated:
Use gd::ValueTypeMetadata instead.

◆ IsOptional()

bool gd::ParameterMetadata::IsOptional ( ) const
inline

Return true if the parameter is optional.

Deprecated:
Use gd::ValueTypeMetadata instead.

◆ SetExtraInfo()

ParameterMetadata& gd::ParameterMetadata::SetExtraInfo ( const gd::String supplementaryInformation_)
inline

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).

Deprecated:
Use gd::ValueTypeMetadata instead.

◆ SetName()

ParameterMetadata& gd::ParameterMetadata::SetName ( const gd::String name_)
inline

Set the name of the parameter.

Name is optional, and won't be filled for most parameters of extensions. It is useful when generating a function from events, where parameters must be named.

◆ SetOptional()

ParameterMetadata& gd::ParameterMetadata::SetOptional ( bool  optional_ = true)
inline

Set if the parameter is optional.

Deprecated:
Use gd::ValueTypeMetadata instead.

◆ SetType()

ParameterMetadata& gd::ParameterMetadata::SetType ( const gd::String type_)
inline

Set the type of the parameter.

Deprecated:
Use gd::ValueTypeMetadata instead.

Member Data Documentation

◆ codeOnly

bool gd::ParameterMetadata::codeOnly

True if parameter is relative to code generation only, i.e. must not be shown in editor


The documentation for this class was generated from the following files: