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(
251 static void MoveEventsFunctionParameter(
255 std::size_t oldIndex,
256 std::size_t newIndex);
266 static void MoveBehaviorEventsFunctionParameter(
271 std::size_t oldIndex,
272 std::size_t newIndex);
282 static void MoveObjectEventsFunctionParameter(
287 std::size_t oldIndex,
288 std::size_t newIndex);
298 static void RenameEventsBasedBehaviorProperty(
313 static void RenameEventsBasedBehaviorSharedProperty(
328 static void RenameEventsBasedObjectProperty(
339 static void ChangeEventsBasedBehaviorPropertyType(
349 static void ChangeEventsBasedObjectPropertyType(
359 static void AddBehaviorAndRequiredBehaviors(
gd::Project& project,
367 static void AddRequiredBehaviorsFor(
gd::Project& project,
375 static std::vector<gd::String> FindDependentBehaviorNames(
383 static std::vector<gd::String> GetBehaviorsWithType(
const gd::Object&
object,
390 static std::vector<gd::UnfilledRequiredBehaviorPropertyProblem>
391 FindInvalidRequiredBehaviorProperties(
const gd::Project& project);
399 FixInvalidRequiredBehaviorProperties(
gd::Project& project);
408 static void RenameEventsBasedBehavior(
421 static void MoveEventsBasedBehavior(
431 static void UpdateBehaviorNameInEventsBasedBehavior(
444 static void RenameEventsBasedObject(
456 static void MoveEventsBasedObject(
466 static void UpdateObjectNameInEventsBasedObject(
480 static void RenameExternalLayout(
gd::Project &project,
486 static void RenameExternalEvents(
gd::Project &project,
500 static void RenameLayerInEventsBasedObject(
517 static void RenameLayerEffectInEventsBasedObject(
526 static void RenameObjectAnimationInScene(
gd::Project &project,
535 static void RenameObjectAnimationInEventsBasedObject(
552 static void RenameObjectPointInEventsBasedObject(
569 static void RenameObjectEffectInEventsBasedObject(
581 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
604 static void BehaviorsAddedToObjectInScene(
gd::Project &project,
614 static void ObjectRemovedInEventsBasedObject(
624 static void RemoveEventsBasedObjectVariant(
635 static void ObjectOrGroupRenamedInEventsBasedObject(
648 static void ObjectOrGroupRenamedInEventsFunction(
662 static void ObjectRemovedInEventsFunction(
673 static void GlobalObjectOrGroupRenamed(
gd::Project& project,
684 static void GlobalObjectRemoved(
gd::Project& project,
694 void BehaviorsAddedToGlobalObject(
gd::Project &project,
701 static std::set<gd::String> GetAllObjectTypesUsingEventsBasedBehavior(
711 static void EnsureBehaviorEventsFunctionsProperParameters(
719 static void EnsureObjectEventsFunctionsProperParameters(
756 const std::map<gd::String, gd::String> &leaderboardIdMap);
761 static std::set<gd::String> FindAllLeaderboardIds(
gd::Project &project);
767 static size_t GetLayoutAndExternalLayoutLayerInstancesCount(
778 static void UpdateBehaviorsSharedData(
gd::Project &project);
783 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
789 static std::vector<gd::String> GetAssociatedExternalLayouts(
791 static std::vector<gd::String>
794 static std::vector<gd::String>
798 static void DoRenameEventsFunction(
gd::Project& project,
822 static void RenameEventsFunctionsExtension(
836 static void MoveEventsBasedBehavior(
852 static void MoveEventsBasedObject(
859 static void FindDependentBehaviorNames(
863 std::unordered_set<gd::String>& dependentBehaviorNames);
865 static std::shared_ptr<VariablesRenamingChangesetNode>
866 ComputeChangesetForVariable(
const gd::Variable &oldVariable,
869 static bool HasAnyVariableTypeChanged(
const gd::Variable &oldVariable,
872 static const gd::String behaviorObjectParameterName;
873 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:39
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