6 #ifndef GDCORE_OBJECTFOLDEROROBJECT_H
7 #define GDCORE_OBJECTFOLDEROROBJECT_H
11 #include "GDCore/Serialization/SerializerElement.h"
12 #include "GDCore/String.h"
13 #include "GDCore/Project/QuickCustomization.h"
18 class SerializerElement;
19 class ObjectsContainer;
57 bool IsFolder()
const {
return !folderName.empty(); }
85 if (IsFolder())
return children.size();
111 if (parent ==
nullptr) {
112 return badObjectFolderOrObject;
126 void MoveChild(std::size_t oldIndex, std::size_t newIndex);
136 void RemoveRecursivelyObjectNamed(
const gd::String& name);
143 std::size_t position = (
size_t)-1);
149 std::size_t position);
165 void MoveObjectFolderOrObjectToAnotherFolder(
168 std::size_t newPosition);
172 quickCustomizationVisibility = visibility;
182 void SerializeTo(SerializerElement& element)
const;
188 const SerializerElement& element,
189 ObjectsContainer& objectsContainer);
204 std::vector<std::unique_ptr<ObjectFolderOrObject>>
Class representing a folder structure in order to organize objects in folders (to be used with an Obj...
Definition: ObjectFolderOrObject.h:30
bool IsRootFolder()
Returns true if the instance is a root folder (that's to say it has no parent).
Definition: ObjectFolderOrObject.h:121
const gd::String & GetFolderName() const
Returns the name of the folder.
Definition: ObjectFolderOrObject.h:61
gd::Object & GetObject() const
Returns the object behind the instance.
Definition: ObjectFolderOrObject.h:52
ObjectFolderOrObject & GetParent()
Returns the parent of the instance. If the instance has no parent (root folder), the null object is r...
Definition: ObjectFolderOrObject.h:110
bool IsFolder() const
Returns true if the instance represents a folder.
Definition: ObjectFolderOrObject.h:57
std::size_t GetChildrenCount() const
Returns the number of children. Returns 0 if the instance represents an object.
Definition: ObjectFolderOrObject.h:84
Represent an object of a platform.
Definition: Object.h:37
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
Visibility
Definition: QuickCustomization.h:8
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24