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

A group event, containing only sub events and some (visual only) properties. More...

#include <GroupEvent.h>

Inherits gd::BaseEvent.

Public Member Functions

virtual gd::GroupEventClone () const
 
virtual bool IsExecutable () const
 
const gd::StringGetName () const
 Get the name of the group.
 
void SetName (const gd::String &name_)
 Change the name of the group.
 
const gd::StringGetSource () const
 Get the source of the group. More...
 
void SetSource (const gd::String &source_)
 Set the source of the group.
 
std::vector< gd::String > & GetCreationParameters ()
 Get the vector containing the parameters that have been used to create the group and its sub events. More...
 
const std::vector< gd::String > & GetCreationParameters () const
 
unsigned int GetCreationTimestamp () const
 Return the creation timestamp. More...
 
void SetCreationTimestamp (unsigned int creationTime_)
 Set timestamp of the creation of the group. More...
 
void SetBackgroundColor (unsigned int colorR, unsigned int colorG, unsigned int colorB)
 Change the color of the group.
 
unsigned int GetBackgroundColorR () const
 Get background color red component.
 
unsigned int GetBackgroundColorG () const
 Get background color green component.
 
unsigned int GetBackgroundColorB () const
 Get background color blue component.
 
virtual bool CanHaveSubEvents () const
 
virtual const gd::EventsListGetSubEvents () const
 
virtual gd::EventsListGetSubEvents ()
 
virtual std::vector< gd::StringGetAllSearchableStrings () const
 Return a list of all strings of the event. More...
 
virtual bool ReplaceAllSearchableStrings (std::vector< gd::String > newSearchableString)
 
virtual void SerializeTo (SerializerElement &element) const
 Serialize event.
 
virtual void UnserializeFrom (gd::Project &project, const SerializerElement &element)
 Unserialize the event.
 
- Public Member Functions inherited from gd::BaseEvent
bool HasSubEvents () const
 Return true if the events has sub events. More...
 
virtual bool CanHaveVariables () const
 
virtual const gd::VariablesContainerGetVariables () const
 
virtual gd::VariablesContainerGetVariables ()
 
bool HasVariables () const
 Return true if the events has local variables. More...
 
virtual std::vector< gd::InstructionsList * > GetAllConditionsVectors ()
 Return a list of all conditions of the event. More...
 
virtual std::vector< const gd::InstructionsList * > GetAllConditionsVectors () const
 
virtual std::vector< gd::InstructionsList * > GetAllActionsVectors ()
 Return a list of all actions of the event. More...
 
virtual std::vector< const gd::InstructionsList * > GetAllActionsVectors () const
 
virtual std::vector< std::pair< gd::Expression *, gd::ParameterMetadata > > GetAllExpressionsWithMetadata ()
 Return a list of all expressions of the event, each with their associated metadata. More...
 
virtual std::vector< std::pair< const gd::Expression *, const gd::ParameterMetadata > > GetAllExpressionsWithMetadata () const
 
virtual const std::vector< gd::String > & GetSourceFileDependencies () const
 Returns the dependencies on source files of the project. More...
 
virtual const gd::StringGetAssociatedGDManagedSourceFile (gd::Project &project) const
 Returns the name of the source file associated with the event. More...
 
virtual gd::String GenerateEventCode (gd::EventsCodeGenerator &codeGenerator, gd::EventsCodeGenerationContext &context)
 Generate the code event: the platform provided by codeGenerator is asked for the EventMetadata associated to the event, which is then used to generate the code event. More...
 
virtual void Preprocess (gd::EventsCodeGenerator &codeGenerator, gd::EventsList &eventList, std::size_t indexOfTheEventInThisList)
 
void PreprocessAsyncActions (const gd::Platform &platform)
 
virtual bool MustBePreprocessed ()
 If MustBePreprocessed is redefined to return true, the gd::EventMetadata::preprocessing associated to the event will be called to preprocess the event. More...
 
virtual bool AcceptVisitor (gd::EventVisitor &eventVisitor)
 
virtual void AcceptVisitor (gd::ReadOnlyEventVisitor &eventVisitor) const
 
const gd::StringGetType () const
 Return the event type.
 
void SetType (gd::String type_)
 Change the event type.
 
void SetDisabled (bool disable=true)
 Set if the event if disabled or not.
 
bool IsDisabled () const
 True if event is disabled.
 
void SetFolded (bool fold=true)
 Set if the event must be folded (i.e: sub events must be hidden in the events editor).
 
bool IsFolded () const
 True if the event should be folded in the events editor.
 

Additional Inherited Members

- Public Attributes inherited from gd::BaseEvent
std::weak_ptr< gd::BaseEventoriginalEvent
 
signed long long totalTimeDuringLastSession
 
float percentDuringLastSession
 

Detailed Description

A group event, containing only sub events and some (visual only) properties.

Member Function Documentation

◆ CanHaveSubEvents()

virtual bool gd::GroupEvent::CanHaveSubEvents ( ) const
inlinevirtual

Derived class have to redefine this function, so as to return true, if they have sub events.

Reimplemented from gd::BaseEvent.

◆ Clone()

virtual gd::GroupEvent* gd::GroupEvent::Clone ( ) const
inlinevirtual

Must return a pointer to a copy of the event. A such method is needed as the IDE may want to store copies of some events and so need a way to do polymorphic copies.

Typical implementation example:

return new MyEventClass(*this);

Reimplemented from gd::BaseEvent.

◆ GetAllSearchableStrings()

vector< gd::String > gd::GroupEvent::GetAllSearchableStrings ( ) const
virtual

Return a list of all strings of the event.

Note
Used to preprocess or search in the event strings.

Reimplemented from gd::BaseEvent.

◆ GetCreationParameters()

std::vector<gd::String>& gd::GroupEvent::GetCreationParameters ( )
inline

Get the vector containing the parameters that have been used to create the group and its sub events.

Note
These parameters are optional and only used to remember how the group was created from an events template for example: if the user wants to update the group with a new version of the template, the parameters can be displayed again to easy the update.

◆ GetCreationTimestamp()

unsigned int gd::GroupEvent::GetCreationTimestamp ( ) const
inline

Return the creation timestamp.

Returns
The timestamp, or 0 if not specified for the group.

◆ GetSource()

const gd::String& gd::GroupEvent::GetSource ( ) const
inline

Get the source of the group.

Note
The source is usually an URL from which the group and its events was downloaded.

◆ GetSubEvents() [1/2]

virtual gd::EventsList& gd::GroupEvent::GetSubEvents ( )
inlinevirtual

Return the sub events, if applicable.

Reimplemented from gd::BaseEvent.

◆ GetSubEvents() [2/2]

virtual const gd::EventsList& gd::GroupEvent::GetSubEvents ( ) const
inlinevirtual

Return the sub events, if applicable.

Reimplemented from gd::BaseEvent.

◆ IsExecutable()

virtual bool gd::GroupEvent::IsExecutable ( ) const
inlinevirtual

Derived class have to redefine this function, so as to return true, if they are executable.

Reimplemented from gd::BaseEvent.

◆ SetCreationTimestamp()

void gd::GroupEvent::SetCreationTimestamp ( unsigned int  creationTime_)
inline

Set timestamp of the creation of the group.

Note
This is purely optional and only used for checking for example if a new version of the group is available, if it has a source URL.

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