GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
A list of objects containers, useful for accessing objects in a scoped way, along with methods to access them. More...
#include <ObjectsContainersList.h>
Public Types | |
enum | VariableExistence { DoesNotExist , Exists , GroupIsEmpty , ExistsOnlyOnSomeObjectsOfTheGroup } |
Public Member Functions | |
bool | HasObjectOrGroupNamed (const gd::String &name) const |
Check if the specified object or group exists. | |
VariableExistence | HasObjectOrGroupWithVariableNamed (const gd::String &objectOrGroupName, const gd::String &variableName) const |
Check if the specified object or group has the specified variable in its declared variables. | |
bool | HasObjectOrGroupVariablesContainer (const gd::String &objectOrGroupName, const gd::VariablesContainer &variablesContainer) const |
Check if the specified object or group has the specified variables container. | |
const gd::VariablesContainer * | GetObjectOrGroupVariablesContainer (const gd::String &objectOrGroupName) const |
Return the container of the variables for the specified object or group of objects. | |
gd::Variable::Type | GetTypeOfObjectOrGroupVariable (const gd::String &objectOrGroupName, const gd::String &variableName) const |
Get a type from an object/group variable. | |
gd::String | GetTypeOfObject (const gd::String &objectName) const |
Get a type from an object/group name. More... | |
bool | HasBehaviorInObjectOrGroup (const gd::String &objectOrGroupName, const gd::String &behaviorName) const |
Check if an object or all object of a group has a behavior. | |
gd::String | GetTypeOfBehaviorInObjectOrGroup (const gd::String &objectOrGroupName, const gd::String &behaviorName, bool searchInGroups=true) const |
Get the type of a behavior if an object or all objects of a group has it. | |
gd::String | GetTypeOfBehavior (const gd::String &behaviorName, bool searchInGroups=true) const |
Get a type from a behavior name. More... | |
std::vector< gd::String > | GetBehaviorsOfObject (const gd::String &objectName, bool searchInGroups=true) const |
Get behaviors of an object/group. More... | |
std::vector< gd::String > | ExpandObjectName (const gd::String &objectOrGroupName, const gd::String &onlyObjectToSelectIfPresent="") const |
Return a list containing all objects refered to by the group. If an object name is passed, then only this object name is returned. More... | |
void | ForEachObject (std::function< void(const gd::Object &object)> fn) const |
void | ForEachNameMatchingSearch (const gd::String &search, std::function< void(const gd::String &name, const gd::ObjectConfiguration *objectConfiguration)> fn) const |
Call the callback for each object or group name matching the search passed in parameter. | |
void | ForEachObjectOrGroupVariableMatchingSearch (const gd::String &objectOrGroupName, const gd::String &search, std::function< void(const gd::String &variableName, const gd::Variable &variable)> fn) const |
Call the callback for each variable of the object (or group) matching the search passed in parameter. | |
ObjectsContainersList () | |
Static Public Member Functions | |
static ObjectsContainersList | MakeNewObjectsContainersListForProjectAndLayout (const gd::Project &project, const gd::Layout &layout) |
static ObjectsContainersList | MakeNewObjectsContainersListForContainers (const gd::ObjectsContainer &globalObjectsContainer, const gd::ObjectsContainer &objectsContainer) |
A list of objects containers, useful for accessing objects in a scoped way, along with methods to access them.
|
inline |
Do not use - should be private but accessible to let Emscripten create a temporary.
std::vector< gd::String > gd::ObjectsContainersList::ExpandObjectName | ( | const gd::String & | objectOrGroupName, |
const gd::String & | onlyObjectToSelectIfPresent = "" |
||
) | const |
Return a list containing all objects refered to by the group. If an object name is passed, then only this object name is returned.
If onlyObjectToSelectIfPresent is set and present in the group(s), only this object will be returned. This is useful for considering this object as the "currently selected" object, when generating a condition or an action.
std::vector< gd::String > gd::ObjectsContainersList::GetBehaviorsOfObject | ( | const gd::String & | objectName, |
bool | searchInGroups = true |
||
) | const |
Get behaviors of an object/group.
gd::String gd::ObjectsContainersList::GetTypeOfBehavior | ( | const gd::String & | behaviorName, |
bool | searchInGroups = true |
||
) | const |
Get a type from a behavior name.
gd::String gd::ObjectsContainersList::GetTypeOfObject | ( | const gd::String & | objectName | ) | const |
Get a type from an object/group name.