GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members

Contains user-friendly info about a parameter, and information about what a parameter need. More...

#include <InstructionMetadata.h>

Public Member Functions

const gd::StringGetType () const
 Return the type of the parameter. More...
 
ParameterMetadataSetType (const gd::String &type_)
 Set the type of the parameter.
 
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).
 
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).
 
bool IsOptional () const
 Return true if the parameter is optional.
 
ParameterMetadataSetOptional (bool optional_=true)
 Set if the parameter is optional.
 
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 "object", "objectPtr" or "objectList". 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...
 

Public Attributes

gd::String type
 Parameter type.
 
gd::String supplementaryInformation
 Used if needed.
 
bool optional
 True if the parameter is optional.
 
gd::String description
 Description shown in editor.
 
bool codeOnly
 

Detailed Description

Contains user-friendly info about a parameter, and information about what a parameter need.

Member Function Documentation

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.

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

Return the type of the parameter.

See also
gd::ParameterMetadata::IsObject
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
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) and in the EventsCodeGenerator.
static bool gd::ParameterMetadata::IsObject ( const gd::String parameterType)
inlinestatic

Return true if the type of the parameter is "object", "objectPtr" or "objectList".

See also
gd::ParameterMetadata::GetType
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.

Member Data Documentation

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: