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

Contains effects applied to an entity on screen (i.e: a Layer or an Object). More...

#include <EffectsContainer.h>

Public Member Functions

 EffectsContainer (const EffectsContainer &other)
 
EffectsContaineroperator= (const EffectsContainer &rhs)
 
bool HasEffectNamed (const gd::String &name) const
 Return true if the effect called "name" exists.
 
EffectGetEffect (const gd::String &name)
 Return a reference to the effect called "name".
 
const EffectGetEffect (const gd::String &name) const
 Return a reference to the effect called "name".
 
EffectGetEffect (std::size_t index)
 
const EffectGetEffect (std::size_t index) const
 
std::size_t GetEffectPosition (const gd::String &name) const
 
std::size_t GetEffectsCount () const
 
gd::EffectInsertNewEffect (const gd::String &name, std::size_t position)
 
void InsertEffect (const Effect &theEffect, std::size_t position)
 Add a copy of the specified effect in the effects list. More...
 
void RemoveEffect (const gd::String &name)
 
void MoveEffect (std::size_t oldIndex, std::size_t newIndex)
 Move the specified effect at a new position in the list.
 
void SwapEffects (std::size_t firstEffectIndex, std::size_t secondEffectIndex)
 
void SerializeTo (SerializerElement &element) const
 Serialize the effects container.
 
void UnserializeFrom (const SerializerElement &element)
 Unserialize the effects container.
 
void Clear ()
 Clear all effects of the container.
 

Detailed Description

Contains effects applied to an entity on screen (i.e: a Layer or an Object).

Member Function Documentation

◆ GetEffect() [1/2]

gd::Effect & gd::EffectsContainer::GetEffect ( std::size_t  index)

Return a reference to the effect at position "index" in the effects list

◆ GetEffect() [2/2]

const gd::Effect & gd::EffectsContainer::GetEffect ( std::size_t  index) const

Return a reference to the effect at position "index" in the effects list

◆ GetEffectPosition()

std::size_t gd::EffectsContainer::GetEffectPosition ( const gd::String name) const

Return the position of the effect called "name" in the effects list

◆ GetEffectsCount()

std::size_t gd::EffectsContainer::GetEffectsCount ( ) const

Return the number of effects.

◆ InsertEffect()

void gd::EffectsContainer::InsertEffect ( const Effect theEffect,
std::size_t  position 
)

Add a copy of the specified effect in the effects list.

Note
No pointer or reference must be kept on the effect passed as parameter.
Parameters
theEffectThe effect that must be copied and inserted into the effects list
positionInsertion position.

◆ InsertNewEffect()

gd::Effect & gd::EffectsContainer::InsertNewEffect ( const gd::String name,
std::size_t  position 
)

Add a new effect at the specified position in the effects list.

◆ RemoveEffect()

void gd::EffectsContainer::RemoveEffect ( const gd::String name)

Remove the specified effect.

◆ SwapEffects()

void gd::EffectsContainer::SwapEffects ( std::size_t  firstEffectIndex,
std::size_t  secondEffectIndex 
)

Swap the position of two effects.


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