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 Member Functions | List of all members
gd::WhileEvent Class Reference

While event is a standard event that is repeated while some conditions are true. More...

#include <WhileEvent.h>

Inherits gd::BaseEvent.

Public Member Functions

virtual gd::WhileEventClone () const
 
virtual bool IsExecutable () const
 
virtual bool CanHaveSubEvents () const
 
virtual const gd::EventsListGetSubEvents () const
 
virtual gd::EventsListGetSubEvents ()
 
const gd::InstructionsListGetConditions () const
 
gd::InstructionsListGetConditions ()
 
const gd::InstructionsListGetActions () const
 
gd::InstructionsListGetActions ()
 
const gd::InstructionsListGetWhileConditions () const
 
gd::InstructionsListGetWhileConditions ()
 
void SetWhileConditions (gd::InstructionsList &whileConditions_)
 
bool HasInfiniteLoopWarning () const
 
virtual std::vector
< gd::InstructionsList * > 
GetAllConditionsVectors ()
 Return a list of all conditions of the event. More...
 
virtual std::vector
< gd::InstructionsList * > 
GetAllActionsVectors ()
 Return a list of all actions of the event. More...
 
virtual std::vector< const
gd::InstructionsList * > 
GetAllConditionsVectors () const
 
virtual std::vector< const
gd::InstructionsList * > 
GetAllActionsVectors () 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
bool HasSubEvents () const
 Return true if the events has sub events. More...
 
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)
 
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...
 
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

While event is a standard event that is repeated while some conditions are true.

Note
The platforms are required to warn the user about a possible infinite loop if the iteration count reach 100 000 and if HasInfiniteLoopWarning() returns true.

Member Function Documentation

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

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

Reimplemented from gd::BaseEvent.

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

vector< gd::InstructionsList * > gd::WhileEvent::GetAllActionsVectors ( )
virtual

Return a list of all actions of the event.

Note
Used to preprocess or search in the actions.

Reimplemented from gd::BaseEvent.

vector< gd::InstructionsList * > gd::WhileEvent::GetAllConditionsVectors ( )
virtual

Return a list of all conditions of the event.

Note
Used to preprocess or search in the conditions.

Reimplemented from gd::BaseEvent.

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

Return the sub events, if applicable.

Reimplemented from gd::BaseEvent.

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

Return the sub events, if applicable.

Reimplemented from gd::BaseEvent.

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

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

Reimplemented from gd::BaseEvent.


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