GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | List of all members
gd::BehaviorsSharedData Class Reference

Base class for defining data shared by behaviors having the same type and name. More...

#include <BehaviorsSharedData.h>

Public Member Functions

virtual gd::BehaviorsSharedDataClone () const
 
gd::String GetTypeName ()
 Return the name identifying the type of the behavior.
 
void SetTypeName (const gd::String &type_)
 Change name identifying the type of the behavior.
 
virtual std::map< gd::String,
gd::PropertyDescriptor
GetProperties (const gd::SerializerElement &behaviorSharedDataContent, gd::Project &project) const
 Called when the IDE wants to know about the properties of the shared data. More...
 
virtual bool UpdateProperty (gd::SerializerElement &behaviorSharedDataContent, const gd::String &name, const gd::String &value, gd::Project &project)
 Called when the IDE wants to update a property of the shared data. More...
 
virtual void InitializeContent (gd::SerializerElement &behaviorSharedDataContent)
 

Detailed Description

Base class for defining data shared by behaviors having the same type and name.

Behaviors can use shared data, as if they were extending the gd::Layout class.

Member Function Documentation

std::map< gd::String, gd::PropertyDescriptor > gd::BehaviorsSharedData::GetProperties ( const gd::SerializerElement behaviorSharedDataContent,
gd::Project project 
) const
virtual

Called when the IDE wants to know about the properties of the shared data.

Usage example:

std::map<gd::String, gd::PropertyDescriptor> properties;
properties[_("Initial speed")].SetValue(gd::String::From(initialSpeed));
return properties;
Returns
a std::map with properties names as key.
See also
gd::PropertyDescriptor
virtual bool gd::BehaviorsSharedData::UpdateProperty ( gd::SerializerElement behaviorSharedDataContent,
const gd::String name,
const gd::String value,
gd::Project project 
)
inlinevirtual

Called when the IDE wants to update a property of the shared data.

Returns
false if the new value cannot be set
See also
gd::InitialInstance

The documentation for this class was generated from the following files: