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(
202 static void MoveEventsFunctionParameter(
206 std::size_t oldIndex,
207 std::size_t newIndex);
217 static void MoveBehaviorEventsFunctionParameter(
222 std::size_t oldIndex,
223 std::size_t newIndex);
233 static void MoveObjectEventsFunctionParameter(
238 std::size_t oldIndex,
239 std::size_t newIndex);
249 static void RenameEventsBasedBehaviorProperty(
264 static void RenameEventsBasedBehaviorSharedProperty(
279 static void RenameEventsBasedObjectProperty(
290 static void AddBehaviorAndRequiredBehaviors(
gd::Project& project,
298 static void AddRequiredBehaviorsFor(
gd::Project& project,
306 static std::vector<gd::String> FindDependentBehaviorNames(
314 static std::vector<gd::String> GetBehaviorsWithType(
const gd::Object&
object,
321 static std::vector<gd::UnfilledRequiredBehaviorPropertyProblem>
322 FindInvalidRequiredBehaviorProperties(
const gd::Project& project);
330 FixInvalidRequiredBehaviorProperties(
gd::Project& project);
339 static void RenameEventsBasedBehavior(
349 static void UpdateBehaviorNameInEventsBasedBehavior(
362 static void RenameEventsBasedObject(
372 static void UpdateObjectNameInEventsBasedObject(
386 static void RenameExternalLayout(
gd::Project &project,
392 static void RenameExternalEvents(
gd::Project &project,
406 static void RenameLayerInEventsBasedObject(
423 static void RenameLayerEffectInEventsBasedObject(
432 static void RenameObjectAnimationInScene(
gd::Project &project,
441 static void RenameObjectAnimationInEventsBasedObject(
458 static void RenameObjectPointInEventsBasedObject(
475 static void RenameObjectEffectInEventsBasedObject(
487 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
510 static void BehaviorsAddedToObjectInScene(
gd::Project &project,
520 static void ObjectRemovedInEventsBasedObject(
530 static void ObjectOrGroupRenamedInEventsBasedObject(
543 static void ObjectOrGroupRenamedInEventsFunction(
557 static void ObjectRemovedInEventsFunction(
568 static void GlobalObjectOrGroupRenamed(
gd::Project& project,
579 static void GlobalObjectRemoved(
gd::Project& project,
589 void BehaviorsAddedToGlobalObject(
gd::Project &project,
596 static std::set<gd::String> GetAllObjectTypesUsingEventsBasedBehavior(
606 static void EnsureBehaviorEventsFunctionsProperParameters(
614 static void EnsureObjectEventsFunctionsProperParameters(
651 const std::map<gd::String, gd::String> &leaderboardIdMap);
656 static std::set<gd::String> FindAllLeaderboardIds(
gd::Project &project);
662 static size_t GetLayoutAndExternalLayoutLayerInstancesCount(
668 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
674 static std::vector<gd::String> GetAssociatedExternalLayouts(
676 static std::vector<gd::String>
679 static std::vector<gd::String>
683 static void DoRenameEventsFunction(
gd::Project& project,
707 static void RenameEventsFunctionsExtension(
721 static void RenameEventsBasedBehavior(
736 static void RenameEventsBasedObject(
743 static void FindDependentBehaviorNames(
747 std::unordered_set<gd::String>& dependentBehaviorNames);
749 static std::shared_ptr<VariablesRenamingChangesetNode>
750 ComputeChangesetForVariable(
const gd::Variable &oldVariable,
753 static bool HasAnyVariableTypeChanged(
const gd::Variable &oldVariable,
756 static const gd::String behaviorObjectParameterName;
757 static const gd::String parentObjectParameterName;
Represents a behavior that is implemented with events.
Definition: EventsBasedBehavior.h:32
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:38
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:51
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