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

Events that can be generated as a stand-alone function, and used as a condition, action or expression. More...

#include <EventsFunction.h>

Public Types

enum  FunctionType {
  Action , Condition , Expression , ExpressionAndCondition ,
  ActionWithOperator
}
 

Public Member Functions

EventsFunctionClone () const
 Return a pointer to a new EventsFunction constructed from this one.
 
const gd::StringGetDescription () const
 Get the description of the function, that is displayed in the editor.
 
EventsFunctionSetDescription (const gd::String &description_)
 Set the description of the function, to be displayed in the editor.
 
const gd::StringGetName () const
 Get the name of the function, to be used for the action/condition/expression name.
 
EventsFunctionSetName (const gd::String &name_)
 Set the name of the function, to be used for the action/condition/expression name.
 
const gd::StringGetFullName () const
 Get the name of the function, that is displayed in the editor.
 
EventsFunctionSetFullName (const gd::String &fullName_)
 Set the name of the function, to be displayed in the editor.
 
const gd::StringGetSentence () const
 Get the sentence of the function, that is used for the condition/action in the Events Editor.
 
EventsFunctionSetSentence (const gd::String &sentence_)
 Set the sentence of the function, to be used for the condition/action in the Events Editor.
 
const gd::StringGetGroup () const
 Get the group of the instruction in the editor.
 
EventsFunctionSetGroup (const gd::String &group_)
 Set the group of the instruction in the editor.
 
const gd::StringGetGetterName () const
 Get the name of the ExpressionAndCondition to use as an operand that is defined in the editor.
 
EventsFunctionSetGetterName (const gd::String &getterName_)
 Set the name of the ExpressionAndCondition to use as an operand that is defined in the editor.
 
EventsFunctionSetExpressionType (const gd::ValueTypeMetadata &type)
 Set the type of the expression.
 
const gd::ValueTypeMetadataGetExpressionType () const
 Get the type of the expression.
 
gd::ValueTypeMetadataGetExpressionType ()
 Get the type of the expression.
 
EventsFunctionSetFunctionType (FunctionType type)
 Set the type of the function.
 
FunctionType GetFunctionType () const
 Get the type of the function.
 
bool IsAction () const
 Return true if the function is an action.
 
bool IsExpression () const
 Return true if the function is an expression. More...
 
bool IsCondition () const
 Return true if the function is a condition. More...
 
bool IsPrivate () const
 Returns true if the function is private.
 
EventsFunctionSetPrivate (bool _isPrivate)
 Sets the privateness of the function.
 
bool IsAsync () const
 Returns true if the function is async.
 
EventsFunctionSetAsync (bool _isAsync)
 Sets the asynchronicity of the function.
 
const gd::EventsListGetEvents () const
 Return the events.
 
gd::EventsListGetEvents ()
 Return the events.
 
const std::vector< gd::ParameterMetadata > & GetParametersForEvents (const gd::EventsFunctionsContainer &functionsContainer) const
 Return the parameters of the function that are used in the events. More...
 
const std::vector< gd::ParameterMetadata > & GetParameters () const
 Return the parameters of the function that are filled in the editor. More...
 
std::vector< gd::ParameterMetadata > & GetParameters ()
 Return the parameters.
 
ObjectGroupsContainerGetObjectGroups ()
 Return a reference to the object groups that can be used in the function.
 
const ObjectGroupsContainerGetObjectGroups () const
 Return a const reference to the object groups that can be used in the function.
 
Serialization
void SerializeTo (gd::SerializerElement &element) const
 Serialize the EventsFunction to the specified element.
 
void UnserializeFrom (gd::Project &project, const gd::SerializerElement &element)
 Load the EventsFunction from the specified element.
 

Detailed Description

Events that can be generated as a stand-alone function, and used as a condition, action or expression.

Note
The code generation can be done using gd::EventsCodeGenerator
The conversion to an extension is not in GDCore and should be done by the IDE (see EventsFunctionsExtensionsLoader)

Member Function Documentation

◆ GetParameters()

const std::vector<gd::ParameterMetadata>& gd::EventsFunction::GetParameters ( ) const
inline

Return the parameters of the function that are filled in the editor.

Note
They won't be used for ActionWithOperator, but they need to be kept to avoid to loose them when the function type is changed.
During code/extension generation, new parameters are added to the generated function, like "runtimeScene" and "eventsFunctionContext". This should be transparent to the user.

◆ GetParametersForEvents()

const std::vector< gd::ParameterMetadata > & gd::EventsFunction::GetParametersForEvents ( const gd::EventsFunctionsContainer functionsContainer) const

Return the parameters of the function that are used in the events.

Note
During code/extension generation, new parameters are added to the generated function, like "runtimeScene" and "eventsFunctionContext". This should be transparent to the user.

◆ IsCondition()

bool gd::EventsFunction::IsCondition ( ) const
inline

Return true if the function is a condition.

Note that a function can be both an expression and a condition.

◆ IsExpression()

bool gd::EventsFunction::IsExpression ( ) const
inline

Return true if the function is an expression.

Note that a function can be both an expression and a condition.


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