GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
A container for objects groups. More...
#include <ObjectGroupsContainer.h>
Public Member Functions | |
ObjectGroupsContainer (const ObjectGroupsContainer &) | |
ObjectGroupsContainer & | operator= (const ObjectGroupsContainer &rhs) |
bool | Has (const gd::String &name) const |
Return true if the specified group is in the container. | |
ObjectGroup & | Get (const gd::String &name) |
Return a reference to the group called name. | |
const ObjectGroup & | Get (const gd::String &name) const |
Return a reference to the group called name. | |
ObjectGroup & | Get (std::size_t index) |
Return the group at position \index in the container. More... | |
const ObjectGroup & | Get (std::size_t index) const |
Return the group at position \index in the container. More... | |
ObjectGroup & | Insert (const ObjectGroup &objectGroup, std::size_t position=-1) |
std::size_t | Count () const |
Return the number of groups. | |
bool | IsEmpty () const |
Return true if the container is empty. | |
std::size_t | GetPosition (const gd::String &name) const |
return the position of the group called "name" in the group list | |
ObjectGroup & | InsertNew (const gd::String &name, std::size_t position=-1) |
Add a new empty group at the specified position in the container. More... | |
void | Remove (const gd::String &name) |
Remove the specified group from the container. | |
bool | Rename (const gd::String &oldName, const gd::String &newName) |
Rename a group. More... | |
void | Move (std::size_t oldIndex, std::size_t newIndex) |
Move the specified group at a new position in the list. | |
void | Clear () |
Clear all groups of the container. | |
void | ForEachNameMatchingSearch (const gd::String &search, std::function< void(const gd::String &name)> fn) const |
Call the callback for each group name matching the specified search. | |
void | Init (const gd::ObjectGroupsContainer &other) |
Saving and loading | |
Members functions related to saving and loading the object. | |
void | SerializeTo (SerializerElement &element) const |
Serialize objects groups container. | |
void | UnserializeFrom (const SerializerElement &element) |
Unserialize the objects groups container. | |
std::vector API compatibility | |
These functions ensure that the class can be used just like a std::vector. | |
size_t | size () const |
Alias for Count() More... | |
bool | empty () const |
Alias for IsEmpty() More... | |
ObjectGroup & | operator[] (size_t index) |
Alias for Get() More... | |
const ObjectGroup & | operator[] (size_t index) const |
Alias for Get() More... | |
ObjectGroup & | at (size_t index) |
Alias for Get() More... | |
const ObjectGroup & | at (size_t index) const |
Alias for Get() More... | |
A container for objects groups.
|
inline |
Alias for Get()
|
inline |
Alias for Get()
|
inline |
Alias for IsEmpty()
ObjectGroup & gd::ObjectGroupsContainer::Get | ( | std::size_t | index | ) |
Return the group at position \index in the container.
const ObjectGroup & gd::ObjectGroupsContainer::Get | ( | std::size_t | index | ) | const |
Return the group at position \index in the container.
void gd::ObjectGroupsContainer::Init | ( | const gd::ObjectGroupsContainer & | other | ) |
Initialize from another object groups container. Used by copy-ctor and assign-op. Don't forget to update me if members were changed!
ObjectGroup & gd::ObjectGroupsContainer::Insert | ( | const ObjectGroup & | objectGroup, |
std::size_t | position = -1 |
||
) |
Add a new group constructed from the group passed as parameter.
objectGroup | The group that must be copied and inserted into the container |
position | Insertion position. If the position is invalid, the group is inserted at the end of the group list. |
ObjectGroup & gd::ObjectGroupsContainer::InsertNew | ( | const gd::String & | name, |
std::size_t | position = -1 |
||
) |
Add a new empty group at the specified position in the container.
name | The new group name |
position | Insertion position. If the position is invalid, the group is inserted at the end of the group list. |
|
inline |
Alias for Get()
|
inline |
Alias for Get()
bool gd::ObjectGroupsContainer::Rename | ( | const gd::String & | oldName, |
const gd::String & | newName | ||
) |
Rename a group.
|
inline |
Alias for Count()