Game Develop Core: gd::LinkEvent Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
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>`

Inheritance diagram for gd::LinkEvent:
[legend]

## Public Member Functions

virtual gd::BaseEventSPtr | Clone () const
const std::string & | GetTarget () const
void | SetTarget (const std::string &target_)
bool | IncludeAllEvents () const
void | SetIncludeAllEvents (bool includeAllEvents)
void | SetIncludeStartAndEnd (unsigned int includeStart_, unsigned int includeEnd_)
unsigned int | GetIncludeStart () const
unsigned int | GetIncludeEnd () const
virtual bool | MustBePreprocessed ()
void | ReplaceLinkByLinkedEvents (gd::Project &project, std::vector< gd::BaseEventSPtr > &eventList, unsigned int 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 | Render (wxDC &dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas &areas, gd::EventsEditorSelection &selection, const gd::Platform &platform)
virtual unsigned int | GetRenderedHeight (unsigned int width, const gd::Platform &platform) const
virtual EditEventReturnType | EditEvent (wxWindow *parent_, gd::Project &game_, gd::Layout &scene_, gd::MainFrameWrapper &mainFrameWrapper_)
virtual void | SaveToXml (TiXmlElement *eventElem) const
virtual void | LoadFromXml (gd::Project &project, const TiXmlElement *eventElem)
Public Member Functions inherited from gd::BaseEvent
virtual bool | CanHaveSubEvents () const
virtual const std::vector < gd::BaseEventSPtr > & | GetSubEvents () const
virtual std::vector < gd::BaseEventSPtr > & | GetSubEvents ()
bool | HasSubEvents () const
| Return true if the events has sub events. More...
virtual std::vector < std::vector< Instruction > * > | GetAllConditionsVectors ()
virtual std::vector < std::vector< Instruction > * > | GetAllActionsVectors ()
virtual std::vector < gd::Expression * > | GetAllExpressions ()
virtual std::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 ( gd::EventMetadata::codeGeneration member ) More...
virtual void | Preprocess (gd::EventsCodeGenerator &codeGenerator, std::vector< gd::BaseEventSPtr > &eventList, unsigned int indexOfTheEventInThisList)
std::string | GetType () const
void | SetType (std::string type_)
void | SetDisabled (bool disable=true)
bool | IsDisabled () const

## Additional Inherited Members

Public Types inherited from gd::BaseEvent
enum | EditEventReturnType { ChangesMade, Cancelled, ChangesMadeButNoNeedForEventsRecompilation }
Public Attributes inherited from gd::BaseEvent
bool | folded
| Here as it must be saved. Used by events editor.
bool | eventHeightNeedUpdate
| Automatically set to true/false by the events editor.
boost::weak_ptr< gd::BaseEvent > | originalEvent
| Pointer only used for profiling events, so as to remember the original event from which it has been copied.
signed long long | totalTimeDuringLastSession
| Total time, in microseconds, used by the event during the last run. Used for profiling.
float | percentDuringLastSession
| Total time used by the event during the last run. Used for profiling.
Protected Attributes inherited from gd::BaseEvent
unsigned int | renderedHeight

## 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::BaseEventSPtr 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 boost::shared_ptr<gd::BaseEvent>(new MyEventClass(*this));

Reimplemented from gd::BaseEvent.

gd::BaseEvent::EditEventReturnType gd::LinkEvent::EditEvent | ( | wxWindow * | parent_,
|  | gd::Project & | game_,
|  | gd::Layout & | scene_,
|  | gd::MainFrameWrapper & | mainFrameWrapper_
| ) |  |

virtual

Called when the user want to edit the event.

Reimplemented from gd::BaseEvent.

unsigned int 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 )

unsigned int 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 )

unsigned int gd::LinkEvent::GetRenderedHeight | ( | unsigned int | width,
|  | const gd::Platform & | platform
| ) |  | const

virtual

Must return the height of the event when rendered

Precompute height for the link

Reimplemented from gd::BaseEvent.

const std::string& gd::LinkEvent::GetTarget | ( | ) |  | const

inline

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

bool gd::LinkEvent::IncludeAllEvents | ( | ) |  | const

inline

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

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.

void gd::LinkEvent::LoadFromXml | ( | gd::Project & | project,
|  | const TiXmlElement * | eventElem
| ) |  |

virtual

Load event from XML

Reimplemented from gd::BaseEvent.

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

inlinevirtual

The link event must always be preprocessed.

Reimplemented from gd::BaseEvent.

void gd::LinkEvent::Render | ( | wxDC & | dc,
|  | int | x,
|  | int | y,
|  | unsigned int | width,
|  | gd::EventsEditorItemsAreas & | areas,
|  | gd::EventsEditorSelection & | selection,
|  | const gd::Platform & | platform
| ) |  |

virtual

Called by event editor to draw the event.

Render the event in the bitmap

Reimplemented from gd::BaseEvent.

void gd::LinkEvent::SaveToXml | ( | TiXmlElement * | eventElem) |  | const

virtual

Save event to XML

Reimplemented from gd::BaseEvent.

void gd::LinkEvent::SetIncludeAllEvents | ( | bool | includeAllEvents) |  |

inline

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

void gd::LinkEvent::SetIncludeStartAndEnd | ( | unsigned int | includeStart_,
|  | unsigned int | 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 std::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:

- LinkEvent.h
- LinkEvent.cpp