Game Develop Core: RepeatEvent.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
RepeatEvent.h
Go to the documentation of this file.
1
6 #ifndef GDCORE_REPEATEVENT_H
7 #define GDCORE_REPEATEVENT_H
8 #include "GDCore/Events/Event.h"
9 namespace gd { class Instruction; }
10 namespace gd { class Project; }
11 class RuntimeScene;
12 class TiXmlElement;
13 namespace gd { class EventsEditorItemsAreas; }
14 namespace gd { class EventsEditorSelection; }
15
16 namespace gd
17 {
18
22 class GD_CORE_API RepeatEvent : public gd::BaseEvent
23 {
24 public:
25 RepeatEvent();
26 RepeatEvent(const RepeatEvent & event);
27 virtual ~RepeatEvent() {};
28
29 RepeatEvent& operator=(const RepeatEvent & event);
30 virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new RepeatEvent(*this));}
31
32 virtual bool IsExecutable() const {return true;}
33
34 virtual bool CanHaveSubEvents() const {return true;}
35 virtual const std::vector < gd::BaseEventSPtr > & GetSubEvents() const {return events;};
36 virtual std::vector < gd::BaseEventSPtr > & GetSubEvents() {return events;};
37 void SetSubEvents(std::vector < gd::BaseEventSPtr > & subEvents_) {events = subEvents_;};
38
39 const std::vector < gd::Instruction > & GetConditions() const { return conditions; };
40 std::vector < gd::Instruction > & GetConditions() { return conditions; };
41 void SetConditions(std::vector < gd::Instruction > & conditions_) { conditions = conditions_; };
42
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 std::string GetRepeatExpression() const { return repeatNumberExpression.GetPlainString(); };
48 std::string GetRepeatExpression() { return repeatNumberExpression.GetPlainString(); };
49 void SetRepeatExpression(std::string repeatNumberExpression_) { repeatNumberExpression = gd::Expression(repeatNumberExpression_); };
50
51 virtual std::vector < std::vector<gd::Instruction>* > GetAllConditionsVectors();
52 virtual std::vector < std::vector<gd::Instruction>* > GetAllActionsVectors();
53 virtual std::vector < gd::Expression* > GetAllExpressions();
54
55 virtual void SaveToXml(TiXmlElement * eventElem) const;
56 virtual void LoadFromXml(gd::Project & project, const TiXmlElement * eventElem);
57
61 virtual void Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform);
62
66 virtual unsigned int GetRenderedHeight(unsigned int width, const gd::Platform & platform) const;
67
71 virtual EditEventReturnType EditEvent(wxWindow* parent_, gd::Project & game_, gd::Layout & scene_, gd::MainFrameWrapper & mainFrameWrapper_);
72
73 private:
74 void Init(const RepeatEvent & event);
75
76 gd::Expression repeatNumberExpression;
77 std::vector < gd::Instruction > conditions;
78 std::vector < gd::Instruction > actions;
79 std::vector < gd::BaseEventSPtr > events;
80
81 bool repeatNumberExpressionSelected;
82 };
83
84 }
85
86 #endif // GDCORE_REPEATEVENT_H