Game Develop Core: InitialInstance.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
InitialInstance.h
Go to the documentation of this file.
1
6 #ifndef GDCORE_INITIALINSTANCE_H
7 #define GDCORE_INITIALINSTANCE_H
8 #include <string>
9 #include <map>
10 #include "GDCore/PlatformDefinition/VariablesContainer.h"
11 namespace gd { class PropgridPropertyDescriptor; }
12 namespace gd { class Project; }
13 namespace gd { class Layout; }
14 class wxPropertyGrid;
15 class wxPropertyGridEvent;
16
17 namespace gd
18 {
19
23 class GD_CORE_API InitialInstance
24 {
25 public:
29 InitialInstance();
30 virtual ~InitialInstance() {};
31
39 InitialInstance * Clone() const { return new InitialInstance(*this); }
40
44
49 const std::string & GetObjectName() const { return objectName; }
50
54 void SetObjectName(const std::string & name) { objectName = name; }
55
59 float GetX() const {return x;}
60
64 void SetX(float x_) { x = x_; }
65
69 float GetY() const {return y;}
70
74 void SetY(float y_) { y = y_; }
75
79 float GetAngle() const {return angle;}
80
84 void SetAngle(float angle_) {angle = angle_;}
85
89 int GetZOrder() const {return zOrder;}
90
94 void SetZOrder(int zOrder_) {zOrder = zOrder_;}
95
99 const std::string & GetLayer() const {return layer;}
100
104 void SetLayer(const std::string & layer_) {layer = layer_;}
105
111 bool HasCustomSize() const { return personalizedSize; }
112
119 void SetHasCustomSize(bool hasCustomSize_ ) { personalizedSize = hasCustomSize_; }
120
121 float GetCustomWidth() const { return width; }
122 void SetCustomWidth(float width_) { width = width_; }
123
124 float GetCustomHeight() const { return height; }
125 void SetCustomHeight(float height_) { height = height_; }
126
127 #if defined(GD_IDE_ONLY)
128
131 bool IsLocked() const { return locked; };
132
138 void SetLocked(bool enable = true) { locked = enable; }
139 #endif
140
142
146
152 const gd::VariablesContainer & GetVariables() const { return initialVariables; }
153
158 gd::VariablesContainer & GetVariables() { return initialVariables; }
160
161 #if defined(GD_IDE_ONLY)
162
175
180 std::map<std::string, gd::PropgridPropertyDescriptor> GetCustomProperties(gd::Project & project, gd::Layout & layout);
181
187 bool UpdateCustomProperty(const std::string & name, const std::string & value, gd::Project & project, gd::Layout & layout);
189 #endif
190
191 //TODO : Refactor this:
192 //In our implementation, more properties can be stored in floatInfos and stringInfos.
193 //These properties are then managed by the Object class.
194 std::map < std::string, float > floatInfos;
195 std::map < std::string, std::string > stringInfos;
196 private:
197
198 std::string objectName;
199 float x;
200 float y;
201 float angle;
202 int zOrder;
203 std::string layer;
204 bool personalizedSize;
205 float width;
206 float height;
207 gd::VariablesContainer initialVariables;
208 bool locked;
209 };
210
211 }
212
213 #endif // GDCORE_INITIALINSTANCE_H