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 Types | Public Member Functions | Public Attributes | List of all members
gd::InstructionMetadata::ExtraInformation Class Reference

Defines information about how generate the code for an instruction. More...

#include <InstructionMetadata.h>

Public Types

enum  AccessType { Reference, MutatorAndOrAccessor, Mutators }

Public Member Functions

ExtraInformationSetFunctionName (const gd::String &functionName_)
ExtraInformationSetManipulatedType (const gd::String &type_)
ExtraInformationSetGetter (const gd::String &getter)
ExtraInformationSetMutators (const std::map< gd::String, gd::String > &mutators)
ExtraInformationSetIncludeFile (const gd::String &includeFile)
 Erase any existing include file and add the specified include.
ExtraInformationAddIncludeFile (const gd::String &includeFile)
 Add a file to the already existing include files.
const std::vector< gd::String > & GetIncludeFiles () const
 Get the files that must be included to use the instruction.
ExtraInformationSetCustomCodeGenerator (std::function< gd::String(Instruction &instruction, gd::EventsCodeGenerator &codeGenerator, gd::EventsCodeGenerationContext &context)> codeGenerator)
ExtraInformationRemoveCustomCodeGenerator ()
bool HasCustomCodeGenerator () const

Public Attributes

gd::String functionCallName
gd::String type
AccessType accessType
gd::String optionalAssociatedInstruction
std::map< gd::String, gd::StringoptionalMutators
bool hasCustomCodeGenerator
std::function< gd::String(Instruction

Detailed Description

Defines information about how generate the code for an instruction.

Member Function Documentation

ExtraInformation& gd::InstructionMetadata::ExtraInformation::SetFunctionName ( const gd::String functionName_)

Set the function name which will be used when generating the code.

functionNamethe name of the function to call
ExtraInformation& gd::InstructionMetadata::ExtraInformation::SetGetter ( const gd::String getter)

If InstructionMetadata::ExtraInformation::SetManipulatedType was called with "number" or "string", this function will tell the code generator the name of the getter function used to retrieve the data value.

Usage example:

_("Change the string"),
_("Change the string of a text"),
_("the string"),
.AddParameter("object", _("Object"), "Text", false)
.AddParameter("operator", _("Modification operator"))
.AddParameter("string", _("String"))
ExtraInformation& gd::InstructionMetadata::ExtraInformation::SetManipulatedType ( const gd::String type_)

Declare if the instruction being declared is somewhat manipulating in a standard way.

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