9 #include <unordered_set>
10 #include <unordered_map>
13 #include "GDCore/String.h"
14 #include "GDCore/Project/Variable.h"
24 class EventsFunctionsExtension;
26 class ObjectsContainer;
27 class VariablesContainer;
28 class EventsBasedBehavior;
29 class EventsBasedObject;
31 class UnfilledRequiredBehaviorPropertyProblem;
33 class SerializerElement;
34 class ProjectScopedContainers;
35 class InitialInstancesContainer;
36 struct VariablesRenamingChangesetNode;
42 std::unordered_map<gd::String, gd::String> oldToNewVariableNames;
43 std::unordered_map<gd::String, std::shared_ptr<gd::VariablesRenamingChangesetNode>>
48 std::unordered_set<gd::String> removedVariableNames;
56 std::unordered_set<gd::String> valueChangedVariableNames;
57 std::unordered_set<gd::String> addedVariableNames;
59 bool HasRemovedVariables() {
return !removedVariableNames.empty(); }
61 VariablesChangeset& ClearRemovedVariables() { removedVariableNames.clear();
return *
this; }
86 static void ApplyRefactoringForVariablesContainer(
95 static void ApplyRefactoringForObjectVariablesContainer(
105 static void ApplyRefactoringForGroupVariablesContainer(
122 static void RenameEventsFunctionsExtension(
132 static void UpdateExtensionNameInExtension(
141 static void UpdateExtensionNameInEventsBasedBehavior(
151 static void UpdateExtensionNameInEventsBasedObject(
164 static void RenameEventsFunction(
177 static void MoveEventsFunction(
191 static void RenameBehaviorEventsFunction(
206 static void RenameObjectEventsFunction(
246 static void MoveEventsFunctionParameter(
250 std::size_t oldIndex,
251 std::size_t newIndex);
261 static void MoveBehaviorEventsFunctionParameter(
266 std::size_t oldIndex,
267 std::size_t newIndex);
277 static void MoveObjectEventsFunctionParameter(
282 std::size_t oldIndex,
283 std::size_t newIndex);
293 static void RenameEventsBasedBehaviorProperty(
308 static void RenameEventsBasedBehaviorSharedProperty(
323 static void RenameEventsBasedObjectProperty(
334 static void ChangeEventsBasedBehaviorPropertyType(
344 static void ChangeEventsBasedObjectPropertyType(
354 static void AddBehaviorAndRequiredBehaviors(
gd::Project& project,
362 static void AddRequiredBehaviorsFor(
gd::Project& project,
370 static std::vector<gd::String> FindDependentBehaviorNames(
378 static std::vector<gd::String> GetBehaviorsWithType(
const gd::Object&
object,
385 static std::vector<gd::UnfilledRequiredBehaviorPropertyProblem>
386 FindInvalidRequiredBehaviorProperties(
const gd::Project& project);
394 FixInvalidRequiredBehaviorProperties(
gd::Project& project);
403 static void RenameEventsBasedBehavior(
416 static void MoveEventsBasedBehavior(
426 static void UpdateBehaviorNameInEventsBasedBehavior(
439 static void RenameEventsBasedObject(
451 static void MoveEventsBasedObject(
461 static void UpdateObjectNameInEventsBasedObject(
475 static void RenameExternalLayout(
gd::Project &project,
481 static void RenameExternalEvents(
gd::Project &project,
495 static void RenameLayerInEventsBasedObject(
512 static void RenameLayerEffectInEventsBasedObject(
521 static void RenameObjectAnimationInScene(
gd::Project &project,
530 static void RenameObjectAnimationInEventsBasedObject(
547 static void RenameObjectPointInEventsBasedObject(
564 static void RenameObjectEffectInEventsBasedObject(
576 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
599 static void BehaviorsAddedToObjectInScene(
gd::Project &project,
609 static void ObjectRemovedInEventsBasedObject(
619 static void ObjectOrGroupRenamedInEventsBasedObject(
632 static void ObjectOrGroupRenamedInEventsFunction(
646 static void ObjectRemovedInEventsFunction(
657 static void GlobalObjectOrGroupRenamed(
gd::Project& project,
668 static void GlobalObjectRemoved(
gd::Project& project,
678 void BehaviorsAddedToGlobalObject(
gd::Project &project,
685 static std::set<gd::String> GetAllObjectTypesUsingEventsBasedBehavior(
695 static void EnsureBehaviorEventsFunctionsProperParameters(
703 static void EnsureObjectEventsFunctionsProperParameters(
740 const std::map<gd::String, gd::String> &leaderboardIdMap);
745 static std::set<gd::String> FindAllLeaderboardIds(
gd::Project &project);
751 static size_t GetLayoutAndExternalLayoutLayerInstancesCount(
762 static void UpdateBehaviorsSharedData(
gd::Project &project);
767 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
773 static std::vector<gd::String> GetAssociatedExternalLayouts(
775 static std::vector<gd::String>
778 static std::vector<gd::String>
782 static void DoRenameEventsFunction(
gd::Project& project,
806 static void RenameEventsFunctionsExtension(
820 static void MoveEventsBasedBehavior(
836 static void MoveEventsBasedObject(
843 static void FindDependentBehaviorNames(
847 std::unordered_set<gd::String>& dependentBehaviorNames);
849 static std::shared_ptr<VariablesRenamingChangesetNode>
850 ComputeChangesetForVariable(
const gd::Variable &oldVariable,
853 static bool HasAnyVariableTypeChanged(
const gd::Variable &oldVariable,
856 static const gd::String behaviorObjectParameterName;
857 static const gd::String parentObjectParameterName;
Represents a behavior that is implemented with events.
Definition: EventsBasedBehavior.h:31
Represents an object that is implemented with events.
Definition: EventsBasedObject.h:32
Events that can be generated as a stand-alone function, and used as a condition, action or expression...
Definition: EventsFunction.h:38
Hold a list of Events Functions (gd::EventsFunction) and Events Based Behaviors.
Definition: EventsFunctionsExtension.h:42
Defines a container of gd::InitialInstances.
Definition: InitialInstancesContainer.h:39
Represents a layer of a layout.
Definition: Layer.h:91
Represent a layout ( also called a scene ) of a project.
Definition: Layout.h:41
Represents an object group.
Definition: ObjectGroup.h:28
Represent an object of a platform.
Definition: Object.h:39
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:38
Expose a subset of the project to workers.
Definition: ProjectBrowser.h:29
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:52
Holds references to variables, objects, properties and other containers.
Definition: ProjectScopedContainers.h:36
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
Defines a variable which can be used by an object, a layout or a project.
Definition: Variable.h:29
Class defining a container for gd::Variable.
Definition: VariablesContainer.h:29
Tool functions to do refactoring on the whole project after changes like deletion or renaming of an o...
Definition: WholeProjectRefactorer.h:72
Definition: CommonTools.h:24
Definition: WholeProjectRefactorer.h:47
std::unordered_set< gd::String > typeChangedVariableNames
Definition: WholeProjectRefactorer.h:55
Definition: WholeProjectRefactorer.h:41