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 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
 
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 ()
 
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
 
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
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 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 std::vector
< gd::Expression * > 
GetAllExpressions ()
 Return a list of all expressions of the event. More...
 
virtual std::vector< const
gd::Expression * > 
GetAllExpressions () 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)
 
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

virtual gd::LinkEvent* gd::LinkEvent::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.

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

Return the include config.

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)

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)

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.
const gd::String& gd::LinkEvent::GetTarget ( ) const
inline

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

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

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

Reimplemented from gd::BaseEvent.

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

The link event must always be preprocessed.

Reimplemented from gd::BaseEvent.

void gd::LinkEvent::SetIncludeAllEvents ( )
inline

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

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 )

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: