GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
ObjectAssetSerializer.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2023 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #pragma once
7 #include <map>
8 #include <vector>
9 #include <unordered_set>
10 
11 #include "GDCore/String.h"
12 
13 namespace gd {
14 class Object;
15 class ExtensionDependency;
16 class PropertyDescriptor;
17 class Project;
18 class Layout;
19 class ArbitraryResourceWorker;
20 class InitialInstance;
21 class SerializerElement;
22 class EffectsContainer;
23 class AbstractFileSystem;
24 class EventsBasedObjectVariant;
25 class ExtensionDependencyCache;
26 } // namespace gd
27 
28 namespace gd {
29 
35 class GD_CORE_API ObjectAssetSerializer {
36 public:
47  static void SerializeTo(gd::Project &project, const gd::Object &object,
48  const gd::String &objectFullName,
49  SerializerElement &element,
50  std::vector<gd::String> &usedResourceNames,
51  ExtensionDependencyCache &extensionDependencyCache);
52 
54 
55 private:
57 
58  static gd::String GetObjectExtensionName(const gd::Object &object);
59 
60  static void SerializeUsedVariantsTo(
61  gd::Project &project, const gd::Object &object,
62  SerializerElement &variantsElement,
63  std::unordered_set<gd::String> &alreadyUsedVariantIdentifiers);
64 
65  static const gd::EventsBasedObjectVariant* GetVariant(gd::Project &project, const gd::Object &object);
66 };
67 
68 } // namespace gd
Represents a variation of style of an events-based object.
Definition: EventsBasedObjectVariant.h:26
Definition: ExtensionDependencyCache.h:26
Serialize objects into an asset for the store.
Definition: ObjectAssetSerializer.h:35
Represent an object of a platform.
Definition: Object.h:39
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24