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 struct VariablesRenamingChangesetNode;
41 std::unordered_map<gd::String, gd::String> oldToNewVariableNames;
42 std::unordered_map<gd::String, std::shared_ptr<gd::VariablesRenamingChangesetNode>>
47 std::unordered_set<gd::String> removedVariableNames;
55 std::unordered_set<gd::String> valueChangedVariableNames;
56 std::unordered_set<gd::String> addedVariableNames;
58 bool HasRemovedVariables() {
return !removedVariableNames.empty(); }
60 VariablesChangeset& ClearRemovedVariables() { removedVariableNames.clear();
return *
this; }
85 static void ApplyRefactoringForVariablesContainer(
94 static void ApplyRefactoringForGroupVariablesContainer(
110 static void RenameEventsFunctionsExtension(
120 static void UpdateExtensionNameInEventsBasedBehavior(
130 static void UpdateExtensionNameInEventsBasedObject(
143 static void RenameEventsFunction(
157 static void RenameBehaviorEventsFunction(
172 static void RenameObjectEventsFunction(
212 static void MoveEventsFunctionParameter(
216 std::size_t oldIndex,
217 std::size_t newIndex);
227 static void MoveBehaviorEventsFunctionParameter(
232 std::size_t oldIndex,
233 std::size_t newIndex);
243 static void MoveObjectEventsFunctionParameter(
248 std::size_t oldIndex,
249 std::size_t newIndex);
259 static void RenameEventsBasedBehaviorProperty(
274 static void RenameEventsBasedBehaviorSharedProperty(
289 static void RenameEventsBasedObjectProperty(
300 static void ChangeEventsBasedBehaviorPropertyType(
310 static void ChangeEventsBasedObjectPropertyType(
320 static void AddBehaviorAndRequiredBehaviors(
gd::Project& project,
328 static void AddRequiredBehaviorsFor(
gd::Project& project,
336 static std::vector<gd::String> FindDependentBehaviorNames(
344 static std::vector<gd::String> GetBehaviorsWithType(
const gd::Object&
object,
351 static std::vector<gd::UnfilledRequiredBehaviorPropertyProblem>
352 FindInvalidRequiredBehaviorProperties(
const gd::Project& project);
360 FixInvalidRequiredBehaviorProperties(
gd::Project& project);
369 static void RenameEventsBasedBehavior(
379 static void UpdateBehaviorNameInEventsBasedBehavior(
392 static void RenameEventsBasedObject(
402 static void UpdateObjectNameInEventsBasedObject(
416 static void RenameExternalLayout(
gd::Project &project,
422 static void RenameExternalEvents(
gd::Project &project,
436 static void RenameLayerInEventsBasedObject(
453 static void RenameLayerEffectInEventsBasedObject(
462 static void RenameObjectAnimationInScene(
gd::Project &project,
471 static void RenameObjectAnimationInEventsBasedObject(
488 static void RenameObjectPointInEventsBasedObject(
505 static void RenameObjectEffectInEventsBasedObject(
517 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
540 static void BehaviorsAddedToObjectInScene(
gd::Project &project,
550 static void ObjectRemovedInEventsBasedObject(
560 static void ObjectOrGroupRenamedInEventsBasedObject(
573 static void ObjectOrGroupRenamedInEventsFunction(
587 static void ObjectRemovedInEventsFunction(
598 static void GlobalObjectOrGroupRenamed(
gd::Project& project,
609 static void GlobalObjectRemoved(
gd::Project& project,
619 void BehaviorsAddedToGlobalObject(
gd::Project &project,
626 static std::set<gd::String> GetAllObjectTypesUsingEventsBasedBehavior(
636 static void EnsureBehaviorEventsFunctionsProperParameters(
644 static void EnsureObjectEventsFunctionsProperParameters(
681 const std::map<gd::String, gd::String> &leaderboardIdMap);
686 static std::set<gd::String> FindAllLeaderboardIds(
gd::Project &project);
692 static size_t GetLayoutAndExternalLayoutLayerInstancesCount(
698 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
704 static std::vector<gd::String> GetAssociatedExternalLayouts(
706 static std::vector<gd::String>
709 static std::vector<gd::String>
713 static void DoRenameEventsFunction(
gd::Project& project,
737 static void RenameEventsFunctionsExtension(
751 static void RenameEventsBasedBehavior(
766 static void RenameEventsBasedObject(
773 static void FindDependentBehaviorNames(
777 std::unordered_set<gd::String>& dependentBehaviorNames);
779 static std::shared_ptr<VariablesRenamingChangesetNode>
780 ComputeChangesetForVariable(
const gd::Variable &oldVariable,
783 static bool HasAnyVariableTypeChanged(
const gd::Variable &oldVariable,
786 static const gd::String behaviorObjectParameterName;
787 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:30
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:39
Represents a layer of a layout.
Definition: Layer.h:91
Represent a layout ( also called a scene ) of a project.
Definition: Layout.h:40
Represents an object group.
Definition: ObjectGroup.h:28
Represent an object of a platform.
Definition: Object.h:37
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:37
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:50
Holds references to variables, objects, properties and other containers.
Definition: ProjectScopedContainers.h:34
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:28
Tool functions to do refactoring on the whole project after changes like deletion or renaming of an o...
Definition: WholeProjectRefactorer.h:71
Definition: CommonTools.h:24
Definition: WholeProjectRefactorer.h:46
std::unordered_set< gd::String > typeChangedVariableNames
Definition: WholeProjectRefactorer.h:54
Definition: WholeProjectRefactorer.h:40