Game Develop Core: Clipboard.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
Clipboard.h
Go to the documentation of this file.
1
5 #ifndef CLIPBOARD_H
6 #define CLIPBOARD_H
7
8 namespace gd { class Layout; }
9 namespace gd { class ExternalEvents; }
10 namespace gd { class ExternalLayout; }
11 #include "GDCore/Events/Event.h"
12 #include "GDCore/Events/Instruction.h"
13 #include "GDCore/PlatformDefinition/ObjectGroup.h"
14 #include "GDCore/PlatformDefinition/Object.h"
15 #include "GDCore/PlatformDefinition/InitialInstance.h"
16 #undef GetObject //Undefining an annoying macro changing GetObject in GetObjectA or GetObjectW
17
18 namespace gd
19 {
20
24 class GD_CORE_API Clipboard
25 {
26 public:
27 static Clipboard * GetInstance();
28 static void DestroySingleton();
29
30 void SetObject( const gd::Object * object );
31 gd::Object * GetObject();
32 bool HasObject() { return hasObject; };
33 void ForgetObject() { hasObject = false; };
34
35 void SetEvents( const std::vector<gd::BaseEventSPtr> & event );
36 std::vector<gd::BaseEventSPtr> GetEvents();
37 bool HasEvents() { return hasEvents; };
38
39 void SetLayout( const gd::Layout * layout );
40 gd::Layout * GetLayout();
41 bool HasLayout() { return hasLayout; };
42
43 void SetExternalEvents( const gd::ExternalEvents * events );
44 gd::ExternalEvents * GetExternalEvents();
45 bool HasExternalEvents() { return hasExternalEvents; };
46
47 void SetExternalLayout( const gd::ExternalLayout * layout );
48 gd::ExternalLayout * GetExternalLayout();
49 bool HasExternalLayout() { return hasExternalLayout; };
50
51 void SetConditions( const std::vector<gd::Instruction> & conditions );
52 void SetActions( const std::vector<gd::Instruction> & actions );
53
54 bool HasCondition() { return hasInstructions && instructionsAreConditions; };
55 bool HasAction() { return hasInstructions && !instructionsAreConditions; };
56 std::vector<gd::Instruction> GetInstructions() const { return instructionsCopied; };
57
58 void SetObjectGroup( const gd::ObjectGroup & group );
59 gd::ObjectGroup GetObjectGroup();
60 bool HasObjectGroup() { return hasObjectGroup; };
61 void ForgetObjectGroup() { hasObjectGroup = false; };
62
63 void SetInstances( std::vector < boost::shared_ptr<InitialInstance> > instances );
64 std::vector < boost::shared_ptr<InitialInstance> > GetInstances() { return instancesCopied; };
65 bool HasInstances() { return hasInstances; };
66
67 private:
68 Clipboard();
69 virtual ~Clipboard();
70
71 gd::Object * objectCopied;
72 bool hasObject;
73
74 std::vector<gd::BaseEventSPtr> eventsCopied;
75 bool hasEvents;
76
77 std::vector<gd::Instruction> instructionsCopied;
78 bool hasInstructions;
79 bool instructionsAreConditions;
80
81 gd::ExternalEvents * externalEventsCopied;
82 bool hasExternalEvents;
83
84 gd::ExternalLayout * externalLayoutCopied;
85 bool hasExternalLayout;
86
87 gd::Layout * layoutCopied;
88 bool hasLayout;
89
90 gd::ObjectGroup objectGroupCopied;
91 bool hasObjectGroup;
92
93 std::vector < boost::shared_ptr<gd::InitialInstance> > instancesCopied;
94 bool hasInstances;
95
96 static Clipboard *singleton;
97 };
98
99 }
100
101 #endif // CLIPBOARD_H