![]() |
GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Inventory all resources used by a project. More...
#include <ResourcesContainer.h>
Public Types | |
| enum | SourceType { Unknown , Global , Parameters , Properties } |
Public Member Functions | |
| ResourcesContainer (const SourceType sourceType) | |
| ResourcesContainer (const ResourcesContainer &) | |
| ResourcesContainer & | operator= (const ResourcesContainer &rhs) |
| SourceType | GetSourceType () const |
| bool | HasResource (const gd::String &name) const |
| Return true if a resource exists. | |
| Resource & | GetResource (const gd::String &name) |
| Return a reference to a resource. | |
| const Resource & | GetResource (const gd::String &name) const |
| Return a reference to a resource. | |
| const gd::String & | GetResourceNameWithOrigin (const gd::String &originName, const gd::String &originIdentifier) const |
| Return the name of the resource with the given origin, if any. If not found, an empty string is returned. | |
| const gd::String & | GetResourceNameWithFile (const gd::String &file) const |
| Return the name of the first resource with the given file, if any. If not found, an empty string is returned. | |
| std::vector< gd::String > | FindFilesNotInResources (const std::vector< gd::String > &filePathsToCheck) const |
| Return a list of the files, from the specified input list, that are not used as files by the resources. | |
| std::shared_ptr< Resource > | CreateResource (const gd::String &kind) |
| Create a new resource but does not add it to the list. | |
| const std::vector< std::shared_ptr< Resource > > & | GetAllResources () const |
| std::vector< gd::String > | GetAllResourceNames () const |
| Get a list containing the names of all resources. | |
| std::shared_ptr< gd::Resource > | GetResourceSPtr (const gd::String &name) |
| Return a (smart) pointer to a resource. | |
| std::size_t | Count () const |
| Return the number of variables. | |
| void | Clear () |
| Clear all variables of the container. | |
| bool | AddResource (const gd::Resource &resource) |
| Add an already constructed resource. More... | |
| bool | AddResource (const gd::String &name, const gd::String &filename, const gd::String &kind) |
| Add a resource created from a file. | |
| void | RemoveResource (const gd::String &name) |
| Remove a resource. | |
| void | RenameResource (const gd::String &oldName, const gd::String &newName) |
| Rename a resource. | |
| std::size_t | GetResourcePosition (const gd::String &name) const |
| Return the position of the layer called "name" in the layers list. | |
| bool | MoveResourceUpInList (const gd::String &name) |
| Move a resource up in the list. | |
| bool | MoveResourceDownInList (const gd::String &name) |
| Move a resource down in the list. | |
| void | MoveResource (std::size_t oldIndex, std::size_t newIndex) |
| Change the position of the specified resource. | |
| void | SerializeTo (SerializerElement &element) const |
| Serialize the object. | |
| void | UnserializeFrom (const SerializerElement &element) |
| Unserialize the object. | |
Static Public Member Functions | |
| static void | SerializeResourceTo (gd::Resource &resource, SerializerElement &resourceElement) |
| Serialize one resource. | |
Inventory all resources used by a project.
| bool gd::ResourcesContainer::AddResource | ( | const gd::Resource & | resource | ) |
Add an already constructed resource.
|
inline |
Get a list containing all the resources.