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

A link pointing to external events (or events of another layout) that should be included and run instead of the link. More...

#include <LinkEvent.h>

Inherits gd::BaseEvent.

Public Types

enum  IncludeConfig { INCLUDE_ALL = 0 , INCLUDE_EVENTS_GROUP = 1 , INCLUDE_BY_INDEX = 2 }
 

Public Member Functions

virtual gd::LinkEventClone () const override
 
const gd::StringGetTarget () const
 
void SetTarget (const gd::String &target_)
 
IncludeConfig GetIncludeConfig () const
 
void SetIncludeAllEvents ()
 
void SetIncludeEventsGroup (const gd::String &name)
 
void SetIncludeStartAndEnd (std::size_t includeStart_, std::size_t includeEnd_)
 
gd::String GetEventsGroupName () const
 
std::size_t GetIncludeStart () const
 
std::size_t GetIncludeEnd () const
 
virtual bool MustBePreprocessed () override
 
const EventsListGetLinkedEvents (const gd::Project &project) const
 Get a pointer to the list of events that are targeted by the link. More...
 
void ReplaceLinkByLinkedEvents (const gd::Project &project, EventsList &eventList, std::size_t indexOfTheEventInThisList)
 Replace the link in the events list by the linked events. When implementing a platform with a link event, you should call this function when preprocessing the events (See gd::EventMetadata::codeGeneration).
 
virtual bool IsExecutable () const override
 
virtual void SerializeTo (SerializerElement &element) const override
 Serialize event.
 
virtual void UnserializeFrom (gd::Project &project, const SerializerElement &element) override
 Unserialize the event.
 
bool AcceptVisitor (gd::EventVisitor &eventVisitor) override
 
void AcceptVisitor (gd::ReadOnlyEventVisitor &eventVisitor) const override
 
- Public Member Functions inherited from gd::BaseEvent
virtual bool CanHaveSubEvents () const
 
virtual const gd::EventsListGetSubEvents () const
 
virtual gd::EventsListGetSubEvents ()
 
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< gd::StringGetAllSearchableStrings () const
 Return a list of all strings of the event. More...
 
virtual bool ReplaceAllSearchableStrings (std::vector< gd::String > newSearchableString)
 
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)
 
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 link pointing to external events (or events of another layout) that should be included and run instead of the link.

Member Function Documentation

◆ Clone()

virtual gd::LinkEvent* gd::LinkEvent::Clone ( ) const
inlineoverridevirtual

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.

◆ GetIncludeConfig()

IncludeConfig gd::LinkEvent::GetIncludeConfig ( ) const
inline

Return the include config.

◆ GetIncludeEnd()

std::size_t gd::LinkEvent::GetIncludeEnd ( ) const
inline

Get the number of the last event to be included. (Meaningful only if includeAll was set to false, see SetIncludeAllEvents)

◆ GetIncludeStart()

std::size_t gd::LinkEvent::GetIncludeStart ( ) const
inline

Get the number of the first event to be included. (Meaningful only if includeAll was set to false, see SetIncludeAllEvents)

◆ GetLinkedEvents()

const EventsList * gd::LinkEvent::GetLinkedEvents ( const gd::Project project) const

Get a pointer to the list of events that are targeted by the link.

Parameters
projectThe project containing the link.
Returns
NULL if nothing is found or a pointer to the list of events being linked.

◆ GetTarget()

const gd::String& gd::LinkEvent::GetTarget ( ) const
inline

Get the link target (i.e. the scene or external events the link refers to).

◆ IsExecutable()

virtual bool gd::LinkEvent::IsExecutable ( ) const
inlineoverridevirtual

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

Reimplemented from gd::BaseEvent.

◆ MustBePreprocessed()

virtual bool gd::LinkEvent::MustBePreprocessed ( )
inlineoverridevirtual

The link event must always be preprocessed.

Reimplemented from gd::BaseEvent.

◆ SetIncludeAllEvents()

void gd::LinkEvent::SetIncludeAllEvents ( )
inline

Return true if the link event must include all the events of the target.

◆ SetIncludeStartAndEnd()

void gd::LinkEvent::SetIncludeStartAndEnd ( std::size_t  includeStart_,
std::size_t  includeEnd_ 
)
inline

Set the number of the first and last event to be included ( Meaningful only if includeAll was set to false, see SetIncludeAllEvents )

◆ SetTarget()

void gd::LinkEvent::SetTarget ( const gd::String target_)
inline

Change the link target (i.e. the scene or external events the link refers to).


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