Game Develop Core: InitialInstancesContainer.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
InitialInstancesContainer.h
Go to the documentation of this file.
1
6 #ifndef GDCORE_INITIALINSTANCESCONTAINER_H
7 #define GDCORE_INITIALINSTANCESCONTAINER_H
8 #include <string>
9 #include <list>
10 #include "GDCore/PlatformDefinition/InitialInstance.h"
11 namespace gd { class InitialInstanceFunctor; }
12 namespace gd { class Project; }
13 class TiXmlElement;
14
15 namespace gd
16 {
17
30 class GD_CORE_API InitialInstancesContainer
31 {
32 public:
33 InitialInstancesContainer() {};
34 virtual ~InitialInstancesContainer();
35
45 InitialInstancesContainer * Clone() const { return new InitialInstancesContainer(*this); };
46
47 #if defined(GD_IDE_ONLY)
48
62 void Create(const InitialInstancesContainer & source);
63 #endif
64
68
73 unsigned int GetInstancesCount() const;
74
79 void IterateOverInstances(InitialInstanceFunctor & func);
80
89 void IterateOverInstancesWithZOrdering(InitialInstanceFunctor & func, const std::string & layer);
90
91 #if defined(GD_IDE_ONLY)
92
96 InitialInstance & InsertInitialInstance(const InitialInstance & instance);
97
102 InitialInstance & InsertNewInitialInstance();
103
107 void RemoveInstance(const gd::InitialInstance & instance);
108
112 void RemoveAllInstancesOnLayer(const std::string & layerName);
113
117 void MoveInstancesToLayer(const std::string & fromLayer, const std::string & toLayer);
118
122 void RemoveInitialInstancesOfObject(const std::string & objectName);
123
127 void RenameInstancesOfObject(const std::string & oldName, const std::string & newName);
128
132 bool SomeInstancesAreOnLayer(const std::string & layerName);
133 #endif
134
139
141 #if defined(GD_IDE_ONLY)
142
145 void SaveToXml(TiXmlElement * element) const;
146 #endif
147
151 void LoadFromXml(const TiXmlElement * element);
153
154 private:
155 std::list<gd::InitialInstance> initialInstances;
156
157 static gd::InitialInstance badPosition;
158 };
159
165 class GD_CORE_API InitialInstanceFunctor
166 {
167 public:
168 InitialInstanceFunctor() {};
169 virtual ~InitialInstanceFunctor();
170
171 virtual void operator()(InitialInstance & instance) = 0;
172 };
173
174 }
175
176 #endif // GDCORE_INITIALINSTANCESCONTAINER_H