GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | Static Public Member Functions | List of all members
gd::ProjectScopedContainers Class Reference

Holds references to variables, objects, properties and other containers. More...

#include <ProjectScopedContainers.h>

Public Member Functions

 ProjectScopedContainers (const gd::ObjectsContainersList &objectsContainersList_, const gd::VariablesContainersList &variablesContainersList_, const gd::VariablesContainer *legacyGlobalVariables_, const gd::VariablesContainer *legacySceneVariables_, const gd::PropertiesContainersList &propertiesContainersList_, const gd::ResourcesContainersList &resourcesContainersList_)
 
ProjectScopedContainersAddPropertiesContainer (const gd::PropertiesContainer &container)
 
ProjectScopedContainersAddParameters (const ParameterMetadataContainer &parameters)
 
template<class ReturnType >
ReturnType MatchIdentifierWithName (const gd::String &name, std::function< ReturnType()> objectCallback, std::function< ReturnType()> variableCallback, std::function< ReturnType()> propertyCallback, std::function< ReturnType()> parameterCallback, std::function< ReturnType()> notFoundCallback) const
 
void ForEachIdentifierMatchingSearch (const gd::String &search, std::function< void(const gd::String &name, const ObjectConfiguration *objectConfiguration)> objectCallback, std::function< void(const gd::String &name, const gd::Variable &variable)> variableCallback, std::function< void(const gd::NamedPropertyDescriptor &property)> propertyCallback, std::function< void(const gd::ParameterMetadata &parameter)> parameterCallback) const
 
const gd::ObjectsContainersListGetObjectsContainersList () const
 
const gd::VariablesContainersListGetVariablesContainersList () const
 
gd::VariablesContainersListGetVariablesContainersList ()
 Allow modification of the variables containers list. This is used by code generation which does push and pop of local variable containers.
 
const gd::VariablesContainerGetLegacyGlobalVariables () const
 Return the global variables of the current scene or the current extension. It allows legacy "globalvar" parameters to accept extension variables.
 
const gd::VariablesContainerGetLegacySceneVariables () const
 Return the scene variables of the current scene or the current extension. It allows legacy "scenevar" parameters to accept extension variables.
 
const gd::PropertiesContainersListGetPropertiesContainersList () const
 
const std::vector< const ParameterMetadataContainer * > & GetParametersVectorsList () const
 
const gd::ResourcesContainersListGetResourcesContainersList () const
 
const gd::StringGetScopeSceneName () const
 Return the name of the scene (layout) in scope, or an empty string if the scope is not a scene.
 
const gd::StringGetScopeExternalEventsName () const
 Return the name of the external events in scope, or an empty string if the scope is not external events.
 
ProjectScopedContainersSetScopeExternalEventsName (const gd::String &externalEventsName)
 Set the external events name for the scope. Used by ProjectBrowserHelper when scanning external events.
 
const gd::StringGetScopeExtensionName () const
 Return the name of the extension in scope, or an empty string if the scope is not an extension function.
 
const gd::StringGetScopeFunctionName () const
 Return the name of the function in scope, or an empty string if the scope is not an extension function.
 
const gd::StringGetScopeBehaviorName () const
 Return the name of the custom behavior in scope, or an empty string if the scope is not a behavior function.
 
const gd::StringGetScopeObjectName () const
 Return the name of the custom object in scope, or an empty string if the scope is not an object function.
 
 ProjectScopedContainers ()
 

Static Public Member Functions

static ProjectScopedContainers MakeNewProjectScopedContainersForProjectAndLayout (const gd::Project &project, const gd::Layout &layout)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForProject (const gd::Project &project)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForEventsFunctionsExtension (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForFreeEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsFunction &eventsFunction, gd::ObjectsContainer &parameterObjectsContainer, gd::VariablesContainer &parameterVariablesContainer, gd::ResourcesContainer &parameterResourcesContainer)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForBehaviorEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::EventsFunction &eventsFunction, gd::ObjectsContainer &parameterObjectsContainer, gd::VariablesContainer &parameterVariablesContainer, gd::VariablesContainer &propertyVariablesContainer, gd::ResourcesContainer &parameterResourcesContainer, gd::ResourcesContainer &propertyResourcesContainer)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForObjectEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedObject &eventsBasedObject, const gd::EventsFunction &eventsFunction, gd::ObjectsContainer &parameterObjectsContainer, gd::VariablesContainer &parameterVariablesContainer, gd::VariablesContainer &propertyVariablesContainer, gd::ResourcesContainer &parameterResourcesContainer, gd::ResourcesContainer &propertyResourcesContainer)
 
static ProjectScopedContainers MakeNewProjectScopedContainersForEventsBasedObject (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedObject &eventsBasedObject, gd::ObjectsContainer &outputObjectsContainer)
 
static ProjectScopedContainers MakeNewProjectScopedContainersWithLocalVariables (const ProjectScopedContainers &projectScopedContainers, const gd::BaseEvent &event)
 

Detailed Description

Holds references to variables, objects, properties and other containers.

This is useful to access elements of a project from a specific location, honoring the scope of each element.

For example, in an expression, when an identifier is written, this class is used to know what this identifier refers too.

Constructor & Destructor Documentation

◆ ProjectScopedContainers()

gd::ProjectScopedContainers::ProjectScopedContainers ( )
inline

Do not use - should be private but accessible to let Emscripten create a temporary.


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