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

A list of resources containers, useful for accessing resources in a scoped way, along with methods to access them. More...

#include <ResourcesContainersList.h>

Public Member Functions

bool HasResourceNamed (const gd::String &name) const
 Check if the specified object exists ignoring groups.
 
const gd::ResourceGetResource (const gd::String &name) const
 
void ForEachResource (std::function< void(const gd::Resource &resource)> fn) const
 
void ForEachNameMatchingSearch (const gd::String &search, std::function< void(const gd::Resource &resource)> fn) const
 Call the callback for each object or group name matching the search passed in parameter.
 
const gd::ResourcesContainer::SourceType GetResourcesContainerSourceType (const gd::String &resourceName) const
 Return the source type of the container for the specified object or group of objects.
 
const gd::ResourcesContainerGetResourcesContainerFromResourceName (const gd::String &resourceName) const
 
const gd::ResourcesContainerGetResourcesContainer (std::size_t index) const
 Return a the objects container at position index. More...
 
std::size_t GetResourcesContainersCount () const
 Return the number of objects containers.
 
 ResourcesContainersList ()
 

Static Public Member Functions

static ResourcesContainersList MakeNewResourcesContainersListForProject (const gd::Project &project)
 
static ResourcesContainersList MakeNewResourcesContainersListForFreeEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &extension, const gd::EventsFunction &eventsFunction, gd::ResourcesContainer &parameterResourcesContainer)
 
static ResourcesContainersList MakeNewResourcesContainersListForBehaviorEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &extension, const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::EventsFunction &eventsFunction, gd::ResourcesContainer &parameterResourcesContainer, gd::ResourcesContainer &propertyResourcesContainer)
 
static ResourcesContainersList MakeNewResourcesContainersListForObjectEventsFunction (const gd::Project &project, const gd::EventsFunctionsExtension &extension, const gd::EventsBasedObject &eventsBasedObject, const gd::EventsFunction &eventsFunction, gd::ResourcesContainer &parameterResourcesContainer, gd::ResourcesContainer &propertyResourcesContainer)
 

Detailed Description

A list of resources containers, useful for accessing resources in a scoped way, along with methods to access them.

See also
gd::Resource
gd::ResourcesContainer
gd::Project
gd::Layout

Constructor & Destructor Documentation

◆ ResourcesContainersList()

gd::ResourcesContainersList::ResourcesContainersList ( )
inline

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

Member Function Documentation

◆ GetResourcesContainer()

const gd::ResourcesContainer& gd::ResourcesContainersList::GetResourcesContainer ( std::size_t  index) const
inline

Return a the objects container at position index.

Warning
The returned ResourcesContainer may contain cloned objects (in the case of ProjectScopedContainers::MakeNewProjectScopedContainersForEventsBasedObject) or "fake" objects used by events like parameters. They must not be used to edit the objects. Search for "ProjectScopedContainers wrongly containing temporary objects containers or objects" in the codebase.

◆ GetResourcesContainerFromResourceName()

const ResourcesContainer & gd::ResourcesContainersList::GetResourcesContainerFromResourceName ( const gd::String resourceName) const

Get the objects container for for the specified object or group of objects.


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