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 UpdateExtensionNameInEventsBasedBehavior(
142 static void UpdateExtensionNameInEventsBasedObject(
155 static void RenameEventsFunction(
169 static void RenameBehaviorEventsFunction(
184 static void RenameObjectEventsFunction(
224 static void MoveEventsFunctionParameter(
228 std::size_t oldIndex,
229 std::size_t newIndex);
239 static void MoveBehaviorEventsFunctionParameter(
244 std::size_t oldIndex,
245 std::size_t newIndex);
255 static void MoveObjectEventsFunctionParameter(
260 std::size_t oldIndex,
261 std::size_t newIndex);
271 static void RenameEventsBasedBehaviorProperty(
286 static void RenameEventsBasedBehaviorSharedProperty(
301 static void RenameEventsBasedObjectProperty(
312 static void ChangeEventsBasedBehaviorPropertyType(
322 static void ChangeEventsBasedObjectPropertyType(
332 static void AddBehaviorAndRequiredBehaviors(
gd::Project& project,
340 static void AddRequiredBehaviorsFor(
gd::Project& project,
348 static std::vector<gd::String> FindDependentBehaviorNames(
356 static std::vector<gd::String> GetBehaviorsWithType(
const gd::Object&
object,
363 static std::vector<gd::UnfilledRequiredBehaviorPropertyProblem>
364 FindInvalidRequiredBehaviorProperties(
const gd::Project& project);
372 FixInvalidRequiredBehaviorProperties(
gd::Project& project);
381 static void RenameEventsBasedBehavior(
391 static void UpdateBehaviorNameInEventsBasedBehavior(
404 static void RenameEventsBasedObject(
414 static void UpdateObjectNameInEventsBasedObject(
428 static void RenameExternalLayout(
gd::Project &project,
434 static void RenameExternalEvents(
gd::Project &project,
448 static void RenameLayerInEventsBasedObject(
465 static void RenameLayerEffectInEventsBasedObject(
474 static void RenameObjectAnimationInScene(
gd::Project &project,
483 static void RenameObjectAnimationInEventsBasedObject(
500 static void RenameObjectPointInEventsBasedObject(
517 static void RenameObjectEffectInEventsBasedObject(
529 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
552 static void BehaviorsAddedToObjectInScene(
gd::Project &project,
562 static void ObjectRemovedInEventsBasedObject(
572 static void ObjectOrGroupRenamedInEventsBasedObject(
585 static void ObjectOrGroupRenamedInEventsFunction(
599 static void ObjectRemovedInEventsFunction(
610 static void GlobalObjectOrGroupRenamed(
gd::Project& project,
621 static void GlobalObjectRemoved(
gd::Project& project,
631 void BehaviorsAddedToGlobalObject(
gd::Project &project,
638 static std::set<gd::String> GetAllObjectTypesUsingEventsBasedBehavior(
648 static void EnsureBehaviorEventsFunctionsProperParameters(
656 static void EnsureObjectEventsFunctionsProperParameters(
693 const std::map<gd::String, gd::String> &leaderboardIdMap);
698 static std::set<gd::String> FindAllLeaderboardIds(
gd::Project &project);
704 static size_t GetLayoutAndExternalLayoutLayerInstancesCount(
710 static void ObjectOrGroupRenamedInScene(
gd::Project &project,
716 static std::vector<gd::String> GetAssociatedExternalLayouts(
718 static std::vector<gd::String>
721 static std::vector<gd::String>
725 static void DoRenameEventsFunction(
gd::Project& project,
749 static void RenameEventsFunctionsExtension(
763 static void RenameEventsBasedBehavior(
778 static void RenameEventsBasedObject(
785 static void FindDependentBehaviorNames(
789 std::unordered_set<gd::String>& dependentBehaviorNames);
791 static std::shared_ptr<VariablesRenamingChangesetNode>
792 ComputeChangesetForVariable(
const gd::Variable &oldVariable,
795 static bool HasAnyVariableTypeChanged(
const gd::Variable &oldVariable,
798 static const gd::String behaviorObjectParameterName;
799 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
Defines a container of gd::InitialInstances.
Definition: InitialInstancesContainer.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: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:72
Definition: CommonTools.h:24
Definition: WholeProjectRefactorer.h:47
std::unordered_set< gd::String > typeChangedVariableNames
Definition: WholeProjectRefactorer.h:55
Definition: WholeProjectRefactorer.h:41