GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
CustomBehaviorsSharedData.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #ifndef GDCORE_CUSTOMBEHAVIORSSHAREDDATA_H
7 #define GDCORE_CUSTOMBEHAVIORSSHAREDDATA_H
8 
9 #include "GDCore/Project/BehaviorsSharedData.h"
10 #include "GDCore/Project/EventsBasedBehavior.h"
11 #include "GDCore/Project/Project.h"
12 #include "GDCore/Project/PropertyDescriptor.h"
13 #include "GDCore/Serialization/Serializer.h"
14 #include "GDCore/Serialization/SerializerElement.h"
15 
16 using namespace gd;
17 
18 namespace gd {
23 public:
24  CustomBehaviorsSharedData(const gd::String &name, const Project &project_,
25  const gd::String &fullType)
26  : BehaviorsSharedData(name, fullType), project(project_) {}
27  CustomBehaviorsSharedData *Clone() const override;
28 
32 
33 protected:
34  std::map<gd::String, gd::PropertyDescriptor>
35  GetProperties(const gd::SerializerElement &behaviorContent) const override;
36  bool UpdateProperty(gd::SerializerElement &behaviorContent,
37  const gd::String &name, const gd::String &value) override;
38  void InitializeContent(gd::SerializerElement &behaviorContent) override;
39 
40 private:
41  const Project &project;
43 };
44 } // namespace gd
45 
46 #endif // GDCORE_CUSTOMBEHAVIORSSHAREDDATA_H
bool UpdateProperty(const gd::String &name, const gd::String &value)
Called when the IDE wants to update a custom property of the behavior.
Definition: BehaviorConfigurationContainer.h:78
virtual void InitializeContent()
Called to initialize the content with the default properties for the behavior.
Definition: BehaviorConfigurationContainer.h:86
std::map< gd::String, gd::PropertyDescriptor > GetProperties() const
Called when the IDE wants to know about the custom properties of the behavior.
Definition: BehaviorConfigurationContainer.cpp:15
Base class for defining data shared by behaviors having the same type and name.
Definition: BehaviorsSharedData.h:24
A gd::BehaviorsSharedData that stores its content in JSON.
Definition: CustomBehaviorsSharedData.h:22
bool UpdateProperty(gd::SerializerElement &behaviorContent, const gd::String &name, const gd::String &value) override
Called when the IDE wants to update a custom property of the behavior.
Definition: CustomBehaviorsSharedData.cpp:47
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:50
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:31
Definition: CommonTools.h:24