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

Class used to track all resources used by a game, or a part of it (like a gd::Object). More...

#include <ResourcesInUseHelper.h>

Inherits gd::ArbitraryResourceWorker.

Public Member Functions

 ResourcesInUseHelper (gd::ResourcesManager &resourcesManager)
 
const std::vector< gd::String > & GetAllResources ()
 
std::set< gd::String > & GetAllImages ()
 
std::set< gd::String > & GetAllAudios ()
 
std::set< gd::String > & GetAllFonts ()
 
std::set< gd::String > & GetAllJsons ()
 
std::set< gd::String > & GetAllTilemaps ()
 
std::set< gd::String > & GetAllTilesets ()
 
std::set< gd::String > & GetAllVideos ()
 
std::set< gd::String > & GetAllBitmapFonts ()
 
std::set< gd::String > & GetAll3DModels ()
 
std::set< gd::String > & GetAllAtlases ()
 
std::set< gd::String > & GetAllSpines ()
 
std::set< gd::String > & GetAll (const gd::String &resourceType)
 
virtual void ExposeFile (gd::String &resource) override
 Expose a raw filename.
 
virtual void ExposeImage (gd::String &resourceName) override
 Expose an image, which is always a reference to a "image" resource.
 
virtual void ExposeAudio (gd::String &resourceName) override
 Expose an audio, which is either a reference to an "audio" resource, or a filename if no resource with this name exists (for backward compatibility).
 
virtual void ExposeFont (gd::String &resourceName) override
 Expose a font, which is either a reference to a "font" resource, or a filename if no resource with this name exists (for backward compatibility).
 
virtual void ExposeJson (gd::String &resourceName) override
 Expose a JSON, which is always a reference to a "json" resource.
 
virtual void ExposeTilemap (gd::String &resourceName) override
 Expose a Tilemap, which is always a reference to a "tilemap" resource.
 
virtual void ExposeTileset (gd::String &resourceName) override
 Expose a Tileset, which is always a reference to a "tileset" resource.
 
virtual void ExposeVideo (gd::String &resourceName) override
 Expose a video, which is always a reference to a "video" resource.
 
virtual void ExposeBitmapFont (gd::String &resourceName) override
 Expose a bitmap font, which is always a reference to a "bitmapFont" resource.
 
virtual void ExposeModel3D (gd::String &resourceName) override
 Expose a 3D model, which is always a reference to a "model3D" resource.
 
virtual void ExposeAtlas (gd::String &resourceName) override
 Expose an atlas, which is always a reference to a "atlas" resource.
 
virtual void ExposeSpine (gd::String &resourceName) override
 Expose an spine, which is always a reference to a "spine" resource.
 
- Public Member Functions inherited from gd::ArbitraryResourceWorker
 ArbitraryResourceWorker (gd::ResourcesManager &resourcesManager_)
 
void ExposeResources ()
 Expose a set of resources. More...
 
void ExposeResourceWithType (const gd::String &resourceType, gd::String &resourceName)
 Expose a resource from a given type.
 
virtual void ExposeShader (gd::String &shaderName)
 Expose a shader. \warn Currently unsupported.
 
virtual void ExposeEmbeddeds (gd::String &resourceName)
 Expose the embedded resources of the specified resource.
 

Protected Attributes

std::vector< gd::StringallResources
 
std::set< gd::StringallImages
 
std::set< gd::StringallAudios
 
std::set< gd::StringallFonts
 
std::set< gd::StringallJsons
 
std::set< gd::StringallTilemaps
 
std::set< gd::StringallTilesets
 
std::set< gd::StringallVideos
 
std::set< gd::StringallBitmapFonts
 
std::set< gd::StringallModel3Ds
 
std::set< gd::StringallAtlases
 
std::set< gd::StringallSpines
 
std::set< gd::StringemptyResources
 
- Protected Attributes inherited from gd::ArbitraryResourceWorker
gd::ResourcesManagerresourcesManager
 

Static Protected Attributes

static const std::vector< gd::StringresourceTypes
 

Detailed Description

Class used to track all resources used by a game, or a part of it (like a gd::Object).

Usage example:

gd::ResourcesInUseHelper resourcesInUse;
//Get a set with the name of all images in the project:
std::set<gd::String> & usedImages = resourcesInUse.GetAllImages();
static void ExposeWholeProjectResources(gd::Project &project, gd::ArbitraryResourceWorker &worker)
Called ( e.g. during compilation ) so as to inventory internal resources, sometimes update their file...
Definition: ResourceExposer.cpp:31
Class used to track all resources used by a game, or a part of it (like a gd::Object).
Definition: ResourcesInUseHelper.h:33

Member Data Documentation

◆ resourceTypes

const std::vector< gd::String > gd::ResourcesInUseHelper::resourceTypes
staticprotected
Initial value:
= {
"image", "audio", "font", "json", "tilemap",
"tileset", "video", "bitmapFont", "model3D"}

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