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

Contains user-friendly information about an object type, and a function to create a new gd::Object of this type. More...

#include <ObjectMetadata.h>

Inherits gd::InstructionOrExpressionContainerMetadata.

Public Member Functions

 ObjectMetadata (const gd::String &extensionNamespace_, const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &icon24x24_, std::shared_ptr< gd::ObjectConfiguration > blueprintObject_)
 Construct an object metadata, using a "blueprint" object that will be copied when a new object is requested.
 
 ObjectMetadata (const gd::String &extensionNamespace_, const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &icon24x24_)
 Construct an object metadata, without "blueprint" object. More...
 
 ObjectMetadata (const gd::String &extensionNamespace_, const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &icon24x24_, CreateFunPtr createFunPtrP)
 Construct an object metadata, with a function that will be called to instantiate a new object.
 
gd::InstructionMetadataAddCondition (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_) override
 Declare a new condition as being part of the extension. More...
 
gd::InstructionMetadataAddAction (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_) override
 Declare a new action as being part of the extension. More...
 
gd::InstructionMetadataAddScopedCondition (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_) override
 
gd::InstructionMetadataAddScopedAction (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_) override
 
gd::ExpressionMetadataAddExpression (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &group_, const gd::String &smallicon_) override
 Declare a new expression as being part of the extension.
 
gd::ExpressionMetadataAddStrExpression (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &group_, const gd::String &smallicon_) override
 Declare a new string expression as being part of the extension.
 
gd::MultipleInstructionMetadata AddExpressionAndCondition (const gd::String &type, const gd::String &name, const gd::String &fullname, const gd::String &description, const gd::String &sentenceName, const gd::String &group, const gd::String &icon) override
 Declare a new expression and condition as being part of the object. More...
 
gd::MultipleInstructionMetadata AddExpressionAndConditionAndAction (const gd::String &type, const gd::String &name, const gd::String &fullname, const gd::String &description, const gd::String &sentenceName, const gd::String &group, const gd::String &icon) override
 Declare a new expression, condition and action as being part of the object. More...
 
gd::InstructionMetadataAddDuplicatedAction (const gd::String &newActionName, const gd::String &copiedActionName) override
 Create a new action which is the duplicate of the specified one. More...
 
gd::InstructionMetadataAddDuplicatedCondition (const gd::String &newConditionName, const gd::String &copiedConditionName) override
 Create a new condition which is the duplicate of the specified one. More...
 
ObjectMetadataSetFullName (const gd::String &fullname_) override
 Set the name shown to the user.
 
ObjectMetadataSetDescription (const gd::String &description_) override
 Set the description shown to the user.
 
const gd::StringGetHelpPath () const override
 Get the help path of the object, relative to the GDevelop documentation root.
 
ObjectMetadataSetHelpPath (const gd::String &path) override
 Set the help path of the object, relative to the GDevelop documentation root. More...
 
ObjectMetadataSetCategoryFullName (const gd::String &categoryFullName_)
 Set the (user friendly) name of the group this object must be categorised in.
 
const std::set< gd::String > & GetDefaultBehaviors () const
 The "capabilities" that are offered by through behaviors.
 
bool HasDefaultBehavior (const gd::String &behaviorType) const
 Return true if object has a default behavior of the given type.
 
ObjectMetadataAddDefaultBehavior (const gd::String &behaviorType)
 Add a "capability" that is offered by through a behavior.
 
ObjectMetadataResetDefaultBehaviorsJustForTesting ()
 
const gd::StringGetName () const override
 
const gd::StringGetFullName () const override
 
const gd::StringGetCategoryFullName () const
 
const gd::StringGetHelpUrl () const
 
const gd::StringGetDescription () const override
 
const gd::StringGetIconFilename () const override
 
ObjectMetadataSetHelpUrl (const gd::String &url)
 Set the URL pointing to the help page about this object. More...
 
ObjectMetadataSetIncludeFile (const gd::String &includeFile) override
 Erase any existing include file and add the specified include. More...
 
ObjectMetadataAddIncludeFile (const gd::String &includeFile) override
 Add a file to the already existing include files.
 
std::map< gd::String, gd::InstructionMetadata > & GetAllActions () override
 Return a reference to a map containing the names of the actions (as keys) and the metadata associated with (as values).
 
std::map< gd::String, gd::InstructionMetadata > & GetAllConditions () override
 
std::map< gd::String, gd::ExpressionMetadata > & GetAllExpressions () override
 
std::map< gd::String, gd::ExpressionMetadata > & GetAllStrExpressions () override
 
ObjectMetadataSetHidden ()
 Set the object to be hidden in the IDE. More...
 
bool IsHidden () const
 Return true if the object must be hidden in the IDE.
 
ObjectMetadataMarkAsRenderedIn3D ()
 Declare a usage of the 3D renderer.
 
bool IsRenderedIn3D () const
 Return true if the object uses the 3D renderer.
 
ObjectMetadataSetOpenFullEditorLabel (const gd::String &label)
 
const gd::StringGetOpenFullEditorLabel () const
 

Public Attributes

std::map< gd::String, gd::InstructionMetadataconditionsInfos
 
std::map< gd::String, gd::InstructionMetadataactionsInfos
 
std::map< gd::String, gd::ExpressionMetadataexpressionsInfos
 
std::map< gd::String, gd::ExpressionMetadatastrExpressionsInfos
 
std::vector< gd::StringincludeFiles
 
gd::String className
 
CreateFunPtr createFunPtr
 

Detailed Description

Contains user-friendly information about an object type, and a function to create a new gd::Object of this type.

Constructor & Destructor Documentation

◆ ObjectMetadata()

gd::ObjectMetadata::ObjectMetadata ( const gd::String extensionNamespace_,
const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String icon24x24_ 
)

Construct an object metadata, without "blueprint" object.

Note
This is used by events based objects.

Member Function Documentation

◆ AddAction()

gd::InstructionMetadata & gd::ObjectMetadata::AddAction ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)
overridevirtual

Declare a new action as being part of the extension.

Deprecated:
Prefer using AddScopedAction, to properly namespace the action.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddCondition()

gd::InstructionMetadata & gd::ObjectMetadata::AddCondition ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)
overridevirtual

Declare a new condition as being part of the extension.

Deprecated:
Prefer using AddScopedCondition, to properly namespace the condition.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddDuplicatedAction()

gd::InstructionMetadata & gd::ObjectMetadata::AddDuplicatedAction ( const gd::String newActionName,
const gd::String copiedActionName 
)
overridevirtual

Create a new action which is the duplicate of the specified one.

Useful for handling a deprecated action that is just a "copy" of the new one.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddDuplicatedCondition()

gd::InstructionMetadata & gd::ObjectMetadata::AddDuplicatedCondition ( const gd::String newConditionName,
const gd::String copiedConditionName 
)
overridevirtual

Create a new condition which is the duplicate of the specified one.

Useful for handling a deprecated condition that is just a "copy" of the new one.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddExpressionAndCondition()

gd::MultipleInstructionMetadata gd::ObjectMetadata::AddExpressionAndCondition ( const gd::String type,
const gd::String name,
const gd::String fullname,
const gd::String description,
const gd::String sentenceName,
const gd::String group,
const gd::String icon 
)
overridevirtual

Declare a new expression and condition as being part of the object.

Note
It's recommended to use this function to avoid declaring twice a similar expression/condition.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddExpressionAndConditionAndAction()

gd::MultipleInstructionMetadata gd::ObjectMetadata::AddExpressionAndConditionAndAction ( const gd::String type,
const gd::String name,
const gd::String fullname,
const gd::String description,
const gd::String sentenceName,
const gd::String group,
const gd::String icon 
)
overridevirtual

Declare a new expression, condition and action as being part of the object.

Note
The action name is prefixed by "Set" (and the namespace, as the condition).
It's recommended to use this function to avoid declaring 3 times a similar expression/condition/action.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddScopedAction()

gd::InstructionMetadata & gd::ObjectMetadata::AddScopedAction ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)
overridevirtual

Declare a new action as being part of the object.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ AddScopedCondition()

gd::InstructionMetadata & gd::ObjectMetadata::AddScopedCondition ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)
overridevirtual

Declare a new condition as being part of the object.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ GetAllConditions()

std::map<gd::String, gd::InstructionMetadata>& gd::ObjectMetadata::GetAllConditions ( )
inlineoverridevirtual

◆ GetAllExpressions()

std::map<gd::String, gd::ExpressionMetadata>& gd::ObjectMetadata::GetAllExpressions ( )
inlineoverridevirtual

◆ GetAllStrExpressions()

std::map<gd::String, gd::ExpressionMetadata>& gd::ObjectMetadata::GetAllStrExpressions ( )
inlineoverridevirtual

◆ SetHelpPath()

ObjectMetadata& gd::ObjectMetadata::SetHelpPath ( const gd::String path)
inlineoverridevirtual

Set the help path of the object, relative to the GDevelop documentation root.

The object instructions will have this help path set by default, unless you call SetHelpPath on them.

Implements gd::InstructionOrExpressionContainerMetadata.

◆ SetHelpUrl()

ObjectMetadata & gd::ObjectMetadata::SetHelpUrl ( const gd::String url)

Set the URL pointing to the help page about this object.

Note
The path to the page must be relative to the wiki url.
Deprecated:
Use SetHelpPath instead

◆ SetHidden()

ObjectMetadata& gd::ObjectMetadata::SetHidden ( )
inline

Set the object to be hidden in the IDE.

Used mainly when an object is deprecated.

◆ SetIncludeFile()

ObjectMetadata & gd::ObjectMetadata::SetIncludeFile ( const gd::String includeFile)
overridevirtual

Erase any existing include file and add the specified include.

Note
The requirement may vary depending on the platform: Most of the time, the include file contains the declaration of the object.
Deprecated:
Use AddIncludeFile instead as clearing the list is more error prone.

Implements gd::InstructionOrExpressionContainerMetadata.


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