mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
1 Commits
v5.1.161
...
generated-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a113ea419 |
@@ -1256,6 +1256,11 @@ size_t EventsCodeGenerator::GenerateSingleUsageUniqueIdFor(
|
||||
|
||||
gd::String EventsCodeGenerator::GetObjectListName(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context) {
|
||||
return GetObjectListNameWithoutNamespace(name, context);
|
||||
}
|
||||
|
||||
gd::String EventsCodeGenerator::GetObjectListNameWithoutNamespace(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context) {
|
||||
return ManObjListName(name);
|
||||
}
|
||||
|
||||
|
@@ -435,6 +435,15 @@ class GD_CORE_API EventsCodeGenerator {
|
||||
*/
|
||||
virtual gd::String GetObjectListName(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context);
|
||||
|
||||
/**
|
||||
* \brief Get the list of objects full name without the namespace.
|
||||
*
|
||||
* Default implementation simply returns the name mangled using
|
||||
* gd::EventsCodeNameMangler.
|
||||
*/
|
||||
virtual gd::String GetObjectListNameWithoutNamespace(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context);
|
||||
|
||||
/**
|
||||
* \brief Generate the code to notify the profiler of the beginning of a
|
||||
|
@@ -945,7 +945,13 @@ gd::String EventsCodeGenerator::GenerateBehaviorAction(
|
||||
|
||||
gd::String EventsCodeGenerator::GetObjectListName(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context) {
|
||||
return GetCodeNamespaceAccessor() + ManObjListName(name) +
|
||||
return GetCodeNamespaceAccessor() +
|
||||
GetObjectListNameWithoutNamespace(name, context);
|
||||
}
|
||||
|
||||
gd::String EventsCodeGenerator::GetObjectListNameWithoutNamespace(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context) {
|
||||
return ManObjListName(name) +
|
||||
gd::String::From(context.GetLastDepthObjectListWasNeeded(name));
|
||||
}
|
||||
|
||||
@@ -1159,8 +1165,8 @@ gd::String EventsCodeGenerator::GenerateObject(
|
||||
|
||||
// Map each declared object to its list.
|
||||
for (auto& objectName : declaredObjectNames) {
|
||||
objectsMapName +=
|
||||
ManObjListName(GetObjectListName(objectName, context));
|
||||
objectsMapName += ManObjListName(
|
||||
GetObjectListNameWithoutNamespace(objectName, context));
|
||||
|
||||
if (!mapDeclaration.empty()) mapDeclaration += ", ";
|
||||
mapDeclaration += "\"" + ConvertToString(objectName) +
|
||||
|
@@ -190,6 +190,12 @@ class EventsCodeGenerator : public gd::EventsCodeGenerator {
|
||||
*/
|
||||
virtual gd::String GetObjectListName(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context);
|
||||
|
||||
/**
|
||||
* \brief Get the list of objects full name without the namespace.
|
||||
*/
|
||||
virtual gd::String GetObjectListNameWithoutNamespace(
|
||||
const gd::String& name, const gd::EventsCodeGenerationContext& context);
|
||||
|
||||
/**
|
||||
* \brief Get the namespace to be used to store code generated
|
||||
|
Reference in New Issue
Block a user