GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | List of all members
gd::PropertiesContainer Class Reference

A container of properties, used for custom behaviors, custom objects, extensions... More...

#include <PropertiesContainer.h>

Public Member Functions

 PropertiesContainer (EventsFunctionsContainer::FunctionOwner owner)
 
 PropertiesContainer (const PropertiesContainer &other)
 
PropertiesContaineroperator= (const PropertiesContainer &other)
 
NamedPropertyDescriptorInsert (const NamedPropertyDescriptor &element, size_t position=(size_t) -1)
 
NamedPropertyDescriptorInsertNew (const gd::String &name, size_t position=(size_t) -1)
 
bool Has (const gd::String &name) const
 
NamedPropertyDescriptorGet (const gd::String &name)
 
const NamedPropertyDescriptorGet (const gd::String &name) const
 
NamedPropertyDescriptorGet (size_t index)
 
const NamedPropertyDescriptorGet (size_t index) const
 
void Remove (const gd::String &name)
 
void Move (std::size_t oldIndex, std::size_t newIndex)
 
size_t GetCount () const
 
std::size_t GetPosition (const NamedPropertyDescriptor &element) const
 
bool IsEmpty () const
 
size_t size () const
 
NamedPropertyDescriptorat (size_t index)
 
bool empty () const
 
const std::vector< std::unique_ptr< NamedPropertyDescriptor > > & GetInternalVector () const
 
std::vector< std::unique_ptr< NamedPropertyDescriptor > > & GetInternalVector ()
 
void SerializeElementsTo (const gd::String &elementName, SerializerElement &element) const
 
void UnserializeElementsFrom (const gd::String &elementName, const SerializerElement &element)
 
void ForEachPropertyMatchingSearch (const gd::String &search, std::function< void(const gd::NamedPropertyDescriptor &property)> fn) const
 
EventsFunctionsContainer::FunctionOwner GetOwner () const
 
gd::NamedPropertyDescriptorInsertNewPropertyInFolder (const gd::String &name, gd::PropertyFolderOrProperty &propertyFolderOrProperty, std::size_t position)
 Add a new empty property called name in the given folder at the specified position.
More...
 
std::vector< const PropertyFolderOrProperty * > GetAllPropertyFolderOrProperty () const
 
gd::PropertyFolderOrPropertyGetRootFolder ()
 
void AddMissingPropertiesInRootFolder ()
 
void SerializeFoldersTo (SerializerElement &element) const
 Serialize folder structure.
 
void UnserializeFoldersFrom (gd::Project &project, const SerializerElement &element)
 Unserialize folder structure.
 

Detailed Description

A container of properties, used for custom behaviors, custom objects, extensions...

See also
gd::NamedPropertyDescriptor

Member Function Documentation

◆ GetAllPropertyFolderOrProperty()

std::vector< const PropertyFolderOrProperty * > gd::PropertiesContainer::GetAllPropertyFolderOrProperty ( ) const

Returns a vector containing all object and folders in this container. Only use this for checking if you hold a valid PropertyFolderOrProperty - don't use this for rendering or anything else.

◆ InsertNewPropertyInFolder()

gd::NamedPropertyDescriptor & gd::PropertiesContainer::InsertNewPropertyInFolder ( const gd::String name,
gd::PropertyFolderOrProperty propertyFolderOrProperty,
std::size_t  position 
)

Add a new empty property called name in the given folder at the specified position.

Returns
A reference to the property in the list.

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