GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
StandardEvent.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 
7 #if defined(GD_IDE_ONLY)
8 #ifndef GDCORE_STANDARDEVENT_H
9 #define GDCORE_STANDARDEVENT_H
10 #include "GDCore/Events/Event.h"
11 #include "GDCore/Events/EventsList.h"
12 #include "GDCore/Events/Instruction.h"
13 #include "GDCore/Events/InstructionsList.h"
14 namespace gd {
15 class Instruction;
16 class Project;
17 }
18 
19 namespace gd {
20 
24 class GD_CORE_API StandardEvent : public gd::BaseEvent {
25  public:
26  StandardEvent();
27  virtual ~StandardEvent();
28  virtual gd::StandardEvent* Clone() const { return new StandardEvent(*this); }
29 
30  virtual bool IsExecutable() const { return true; }
31 
32  virtual bool CanHaveSubEvents() const { return true; }
33  virtual const gd::EventsList& GetSubEvents() const { return events; };
34  virtual gd::EventsList& GetSubEvents() { return events; };
35 
36  const gd::InstructionsList& GetConditions() const { return conditions; };
37  gd::InstructionsList& GetConditions() { return conditions; };
38 
39  const gd::InstructionsList& GetActions() const { return actions; };
40  gd::InstructionsList& GetActions() { return actions; };
41 
42  virtual std::vector<const gd::InstructionsList*> GetAllConditionsVectors()
43  const;
44  virtual std::vector<const gd::InstructionsList*> GetAllActionsVectors() const;
45  virtual std::vector<gd::InstructionsList*> GetAllConditionsVectors();
46  virtual std::vector<gd::InstructionsList*> GetAllActionsVectors();
47 
48  virtual void SerializeTo(SerializerElement& element) const;
49  virtual void UnserializeFrom(gd::Project& project,
50  const SerializerElement& element);
51 
52  private:
53  gd::InstructionsList conditions;
54  gd::InstructionsList actions;
55  EventsList events;
56 };
57 
58 } // namespace gd
59 
60 #endif // GDCORE_STANDARDEVENT_H
61 #endif
Base class defining an event.
Definition: Event.h:44
A list of events.
Definition: EventsList.h:33
Definition: InstructionsList.h:25
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:50
Standard event, with conditions, actions and support for sub events.
Definition: StandardEvent.h:24
virtual bool IsExecutable() const
Definition: StandardEvent.h:30
virtual gd::StandardEvent * Clone() const
Definition: StandardEvent.h:28
virtual const gd::EventsList & GetSubEvents() const
Definition: StandardEvent.h:33
virtual gd::EventsList & GetSubEvents()
Definition: StandardEvent.h:34
virtual bool CanHaveSubEvents() const
Definition: StandardEvent.h:32
Definition: CommonTools.h:24