GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | List of all members
gd::ObjectGroupsContainer Class Reference

A container for objects groups. More...

#include <ObjectGroupsContainer.h>

Public Member Functions

bool Has (const gd::String &name) const
 Return true if the specified group is in the container.
 
ObjectGroupGet (const gd::String &name)
 Return a reference to the group called name.
 
const ObjectGroupGet (const gd::String &name) const
 Return a reference to the group called name.
 
ObjectGroupGet (std::size_t index)
 Return the group at position in the container. More...
 
const ObjectGroupGet (std::size_t index) const
 Return the group at position in the container. More...
 
ObjectGroupInsert (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
 
ObjectGroupInsertNew (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.
 
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...
 
ObjectGroupoperator[] (size_t index)
 Alias for Get() More...
 
const ObjectGroupoperator[] (size_t index) const
 Alias for Get() More...
 
ObjectGroupat (size_t index)
 Alias for Get() More...
 
const ObjectGroupat (size_t index) const
 Alias for Get() More...
 

Detailed Description

A container for objects groups.

See also
gd::Project
gd::Layout

Member Function Documentation

ObjectGroup& gd::ObjectGroupsContainer::at ( size_t  index)
inline

Alias for Get()

See also
ObjectGroupsContainer::Get.
const ObjectGroup& gd::ObjectGroupsContainer::at ( size_t  index) const
inline

Alias for Get()

See also
ObjectGroupsContainer::Get.
bool gd::ObjectGroupsContainer::empty ( ) const
inline
ObjectGroup & gd::ObjectGroupsContainer::Get ( std::size_t  index)

Return the group at position in the container.

Note
If index is invalid, an empty group is returned.
const ObjectGroup & gd::ObjectGroupsContainer::Get ( std::size_t  index) const

Return the group at position in the container.

Note
If index is invalid, an empty group is returned.
ObjectGroup & gd::ObjectGroupsContainer::Insert ( const ObjectGroup objectGroup,
std::size_t  position = -1 
)

Add a new group constructed from the group passed as parameter.

Parameters
objectGroupThe group that must be copied and inserted into the container
positionInsertion position. If the position is invalid, the group is inserted at the end of the group list.
Returns
Reference to the newly added group
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.

Parameters
nameThe new group name
positionInsertion position. If the position is invalid, the group is inserted at the end of the group list.
Returns
Reference to the newly added group
ObjectGroup& gd::ObjectGroupsContainer::operator[] ( size_t  index)
inline

Alias for Get()

See also
ObjectGroupsContainer::Get.
const ObjectGroup& gd::ObjectGroupsContainer::operator[] ( size_t  index) const
inline

Alias for Get()

See also
ObjectGroupsContainer::Get.
bool gd::ObjectGroupsContainer::Rename ( const gd::String oldName,
const gd::String newName 
)

Rename a group.

Returns
true if the group was renamed, false otherwise.
size_t gd::ObjectGroupsContainer::size ( ) const
inline

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