18
18
#include " GDCore/Extensions/Platform.h"
19
19
#include " GDCore/IDE/PlatformManager.h"
20
20
#include " GDCore/Project/Behavior.h"
21
- #include " GDCore/Project/ObjectConfiguration.h"
22
21
#include " GDCore/Project/BehaviorsSharedData.h"
22
+ #include " GDCore/Project/ObjectConfiguration.h"
23
23
#include " GDCore/Tools/Localization.h"
24
24
25
25
namespace gd {
@@ -200,11 +200,11 @@ PlatformExtension::AddExpressionAndConditionAndAction(
200
200
group,
201
201
icon)
202
202
: AddStrExpression (name,
203
- fullname,
204
- expressionDescriptionTemplate.FindAndReplace (
205
- " <subject>" , descriptionSubject),
206
- group,
207
- icon);
203
+ fullname,
204
+ expressionDescriptionTemplate.FindAndReplace (
205
+ " <subject>" , descriptionSubject),
206
+ group,
207
+ icon);
208
208
209
209
return MultipleInstructionMetadata::WithExpressionAndConditionAndAction (
210
210
expression, condition, action);
@@ -244,12 +244,10 @@ gd::ObjectMetadata& PlatformExtension::AddEventsBasedObject(
244
244
const gd::String& description,
245
245
const gd::String& icon24x24) {
246
246
gd::String nameWithNamespace = GetNameSpace () + name;
247
- objectsInfos[nameWithNamespace] = ObjectMetadata (GetNameSpace (),
248
- nameWithNamespace,
249
- fullname,
250
- description,
251
- icon24x24)
252
- .SetHelpPath (GetHelpPath ());
247
+ objectsInfos[nameWithNamespace] =
248
+ ObjectMetadata (
249
+ GetNameSpace (), nameWithNamespace, fullname, description, icon24x24)
250
+ .SetHelpPath (GetHelpPath ());
253
251
return objectsInfos[nameWithNamespace];
254
252
}
255
253
@@ -353,8 +351,7 @@ gd::BehaviorMetadata& PlatformExtension::GetBehaviorMetadata(
353
351
return badBehaviorMetadata;
354
352
}
355
353
356
- bool PlatformExtension::HasBehavior (
357
- const gd::String& behaviorType) const {
354
+ bool PlatformExtension::HasBehavior (const gd::String& behaviorType) const {
358
355
return behaviorsInfo.find (behaviorType) != behaviorsInfo.end ();
359
356
}
360
357
@@ -386,7 +383,7 @@ gd::InstructionMetadata& PlatformExtension::AddDuplicatedAction(
386
383
auto copiedAction = actionsInfos.find (copiedNameWithNamespace);
387
384
if (copiedAction == actionsInfos.end ()) {
388
385
gd::LogError (" Could not find an action with name " +
389
- copiedNameWithNamespace + " to copy." );
386
+ copiedNameWithNamespace + " to copy." );
390
387
} else {
391
388
actionsInfos[newNameWithNamespace] = copiedAction->second ;
392
389
}
@@ -406,7 +403,7 @@ gd::InstructionMetadata& PlatformExtension::AddDuplicatedCondition(
406
403
auto copiedCondition = conditionsInfos.find (copiedNameWithNamespace);
407
404
if (copiedCondition == conditionsInfos.end ()) {
408
405
gd::LogError (" Could not find a condition with name " +
409
- copiedNameWithNamespace + " to copy." );
406
+ copiedNameWithNamespace + " to copy." );
410
407
} else {
411
408
conditionsInfos[newNameWithNamespace] = copiedCondition->second ;
412
409
}
@@ -423,7 +420,7 @@ gd::ExpressionMetadata& PlatformExtension::AddDuplicatedExpression(
423
420
auto copiedExpression = expressionsInfos.find (copiedNameWithNamespace);
424
421
if (copiedExpression == expressionsInfos.end ()) {
425
422
gd::LogError (" Could not find an expression with name " +
426
- copiedNameWithNamespace + " to copy." );
423
+ copiedNameWithNamespace + " to copy." );
427
424
} else {
428
425
expressionsInfos[newNameWithNamespace] = copiedExpression->second ;
429
426
}
@@ -440,7 +437,7 @@ gd::ExpressionMetadata& PlatformExtension::AddDuplicatedStrExpression(
440
437
auto copiedExpression = strExpressionsInfos.find (copiedNameWithNamespace);
441
438
if (copiedExpression == strExpressionsInfos.end ()) {
442
439
gd::LogError (" Could not find a string expression with name " +
443
- copiedNameWithNamespace + " to copy." );
440
+ copiedNameWithNamespace + " to copy." );
444
441
} else {
445
442
strExpressionsInfos[newNameWithNamespace] = copiedExpression->second ;
446
443
}
@@ -468,15 +465,17 @@ PlatformExtension::GetAllStrExpressions() {
468
465
return strExpressionsInfos;
469
466
}
470
467
471
- const std::vector<gd::DependencyMetadata>& PlatformExtension::GetAllDependencies () const {
468
+ const std::vector<gd::DependencyMetadata>&
469
+ PlatformExtension::GetAllDependencies () const {
472
470
return extensionDependenciesMetadata;
473
471
}
474
472
475
473
std::vector<gd::DependencyMetadata>& PlatformExtension::GetAllDependencies () {
476
474
return extensionDependenciesMetadata;
477
475
}
478
476
479
- const std::vector<gd::SourceFileMetadata>& PlatformExtension::GetAllSourceFiles () const {
477
+ const std::vector<gd::SourceFileMetadata>&
478
+ PlatformExtension::GetAllSourceFiles () const {
480
479
return extensionSourceFilesMetadata;
481
480
}
482
481
@@ -615,37 +614,6 @@ void PlatformExtension::SetNameSpace(gd::String nameSpace_) {
615
614
nameSpace = nameSpace_ + GetNamespaceSeparator ();
616
615
}
617
616
618
- std::vector<gd::String> PlatformExtension::GetBuiltinExtensionsNames () {
619
- std::vector<gd::String> builtinExtensions;
620
- builtinExtensions.push_back (" Sprite" );
621
- builtinExtensions.push_back (" BuiltinObject" );
622
- builtinExtensions.push_back (" BuiltinAudio" );
623
- builtinExtensions.push_back (" BuiltinMouse" );
624
- builtinExtensions.push_back (" BuiltinKeyboard" );
625
- builtinExtensions.push_back (" BuiltinJoystick" );
626
- builtinExtensions.push_back (" BuiltinTime" );
627
- builtinExtensions.push_back (" BuiltinFile" );
628
- builtinExtensions.push_back (" BuiltinVariables" );
629
- builtinExtensions.push_back (" BuiltinCamera" );
630
- builtinExtensions.push_back (" BuiltinWindow" );
631
- builtinExtensions.push_back (" BuiltinNetwork" );
632
- builtinExtensions.push_back (" BuiltinScene" );
633
- builtinExtensions.push_back (" BuiltinAdvanced" );
634
- builtinExtensions.push_back (" BuiltinCommonConversions" );
635
- builtinExtensions.push_back (" BuiltinStringInstructions" );
636
- builtinExtensions.push_back (" BuiltinMathematicalTools" );
637
- builtinExtensions.push_back (" BuiltinExternalLayouts" );
638
- builtinExtensions.push_back (" BuiltinCommonInstructions" );
639
-
640
- return builtinExtensions;
641
- }
642
-
643
- bool PlatformExtension::IsBuiltin () const {
644
- std::vector<gd::String> builtinExtensions = GetBuiltinExtensionsNames ();
645
- return std::find (builtinExtensions.begin (), builtinExtensions.end (), name) !=
646
- builtinExtensions.end ();
647
- }
648
-
649
617
void PlatformExtension::StripUnimplementedInstructionsAndExpressions () {
650
618
for (std::map<gd::String, gd::InstructionMetadata>::iterator it =
651
619
GetAllActions ().begin ();
@@ -791,41 +759,42 @@ void PlatformExtension::StripUnimplementedInstructionsAndExpressions() {
791
759
}
792
760
}
793
761
794
- gd::String
795
- PlatformExtension::GetEventsFunctionFullType (const gd::String &extensionName,
796
- const gd::String &functionName) {
797
- const auto &separator = GetNamespaceSeparator ();
762
+ gd::String PlatformExtension::GetEventsFunctionFullType (
763
+ const gd::String& extensionName, const gd::String& functionName) {
764
+ const auto & separator = GetNamespaceSeparator ();
798
765
return extensionName + separator + functionName;
799
766
}
800
767
801
768
gd::String PlatformExtension::GetBehaviorEventsFunctionFullType (
802
- const gd::String &extensionName, const gd::String &behaviorName,
803
- const gd::String &functionName) {
804
- const auto &separator = GetNamespaceSeparator ();
769
+ const gd::String& extensionName,
770
+ const gd::String& behaviorName,
771
+ const gd::String& functionName) {
772
+ const auto & separator = GetNamespaceSeparator ();
805
773
return extensionName + separator + behaviorName + separator + functionName;
806
774
}
807
775
808
- gd::String
809
- PlatformExtension::GetBehaviorFullType (const gd::String &extensionName,
810
- const gd::String &behaviorName) {
811
- const auto &separator = GetNamespaceSeparator ();
776
+ gd::String PlatformExtension::GetBehaviorFullType (
777
+ const gd::String& extensionName, const gd::String& behaviorName) {
778
+ const auto & separator = GetNamespaceSeparator ();
812
779
return extensionName + separator + behaviorName;
813
780
}
814
781
815
782
gd::String PlatformExtension::GetObjectEventsFunctionFullType (
816
- const gd::String &extensionName, const gd::String &objectName,
817
- const gd::String &functionName) {
818
- const auto &separator = GetNamespaceSeparator ();
783
+ const gd::String& extensionName,
784
+ const gd::String& objectName,
785
+ const gd::String& functionName) {
786
+ const auto & separator = GetNamespaceSeparator ();
819
787
return extensionName + separator + objectName + separator + functionName;
820
788
}
821
789
822
- gd::String PlatformExtension::GetObjectFullType (const gd::String & extensionName,
823
- const gd::String & objectName) {
824
- const auto & separator = GetNamespaceSeparator ();
790
+ gd::String PlatformExtension::GetObjectFullType (const gd::String& extensionName,
791
+ const gd::String& objectName) {
792
+ const auto & separator = GetNamespaceSeparator ();
825
793
return extensionName + separator + objectName;
826
794
}
827
795
828
- gd::String PlatformExtension::GetExtensionFromFullObjectType (const gd::String& type) {
796
+ gd::String PlatformExtension::GetExtensionFromFullObjectType (
797
+ const gd::String& type) {
829
798
const auto separatorIndex =
830
799
type.find (PlatformExtension::GetNamespaceSeparator ());
831
800
if (separatorIndex == std::string::npos) {
@@ -834,7 +803,8 @@ gd::String PlatformExtension::GetExtensionFromFullObjectType(const gd::String& t
834
803
return type.substr (0 , separatorIndex);
835
804
}
836
805
837
- gd::String PlatformExtension::GetObjectNameFromFullObjectType (const gd::String& type) {
806
+ gd::String PlatformExtension::GetObjectNameFromFullObjectType (
807
+ const gd::String& type) {
838
808
const auto separatorIndex =
839
809
type.find (PlatformExtension::GetNamespaceSeparator ());
840
810
if (separatorIndex == std::string::npos) {
0 commit comments