Game Develop Core: StandardEvent.h Source File

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

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
StandardEvent.h
Go to the documentation of this file.
1
6 #ifndef GDCORE_STANDARDEVENT_H
7 #define GDCORE_STANDARDEVENT_H
8 #include "GDCore/Events/Event.h"
9 namespace gd { class Instruction; }
10 namespace gd { class Project; }
11 class RuntimeScene;
12 class TiXmlElement;
13 class EventsCodeGenerationContext;
14 namespace gd { class EventsEditorItemsAreas; }
15 namespace gd { class EventsEditorSelection; }
16
17 namespace gd
18 {
19
23 class GD_CORE_API StandardEvent : public gd::BaseEvent
24 {
25 public:
26 StandardEvent();
27 StandardEvent(const StandardEvent & event);
28 virtual ~StandardEvent();
29
30 StandardEvent& operator=(const StandardEvent & event);
31 virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new StandardEvent(*this));}
32
33 virtual bool IsExecutable() const {return true;}
34
35 virtual bool CanHaveSubEvents() const {return true;}
36 virtual const std::vector < gd::BaseEventSPtr > & GetSubEvents() const {return events;};
37 virtual std::vector < gd::BaseEventSPtr > & GetSubEvents() {return events;};
38 void SetSubEvents(std::vector < gd::BaseEventSPtr > & subEvents_) {events = subEvents_;};
39
40 const std::vector < gd::Instruction > & GetConditions() const { return conditions; };
41 std::vector < gd::Instruction > & GetConditions() { return conditions; };
42 void SetConditions(std::vector < gd::Instruction > & conditions_) { conditions = conditions_; };
43 const std::vector < gd::Instruction > & GetActions() const { return actions; };
44 std::vector < gd::Instruction > & GetActions() { return actions; };
45 void SetActions(std::vector < gd::Instruction > & actions_) { actions = actions_; };
46
47 virtual std::vector < std::vector<gd::Instruction>* > GetAllConditionsVectors();
48 virtual std::vector < std::vector<gd::Instruction>* > GetAllActionsVectors();
49
50 virtual void SaveToXml(TiXmlElement * eventElem) const;
51 virtual void LoadFromXml(gd::Project & project, const TiXmlElement * eventElem);
52
56 virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
57
61 virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
62
63 private:
64 void Init(const StandardEvent & event);
65
66 std::vector < gd::Instruction > conditions;
67 std::vector < gd::Instruction > actions;
68 std::vector < gd::BaseEventSPtr > events;
69 };
70
71 }
72
73 #endif // GDCORE_STANDARDEVENT_H