GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Static Public Member Functions | List of all members
gd::WholeProjectRefactorer Class Reference

Tool functions to do refactoring on the whole project after changes like deletion or renaming of an object. More...

#include <WholeProjectRefactorer.h>

Static Public Member Functions

static void ExposeProjectEvents (gd::Project &project, gd::ArbitraryEventsWorker &worker)
 Call the specified worker on all events of the project (layout, external events, events functions...) More...
 
static void ExposeProjectEvents (gd::Project &project, gd::ArbitraryEventsWorkerWithContext &worker)
 Call the specified worker on all events of the project (layout, external events, events functions...) More...
 
static void RenameEventsFunctionsExtension (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::String &oldName, const gd::String &newName)
 Refactor the project after an events function extension is renamed.
 
static void RenameEventsFunction (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::String &oldFunctionName, const gd::String &newFunctionName)
 Refactor the project after an events function is renamed.
 
static void RenameBehaviorEventsFunction (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::String &oldFunctionName, const gd::String &newFunctionName)
 Refactor the project after an events function of a behavior is renamed.
 
static void MoveEventsFunctionParameter (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::String &functionName, std::size_t oldIndex, std::size_t newIndex)
 Refactor the project after an events function parameter was moved.
 
static void MoveBehaviorEventsFunctionParameter (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::String &functionName, std::size_t oldIndex, std::size_t newIndex)
 Refactor the project after the parmaeter of an events function of a behavior was moved.
 
static void RenameBehaviorProperty (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior, const gd::String &oldPropertyName, const gd::String &newPropertyName)
 Refactor the project after a property of a behavior is renamed.
 
static void RenameEventsBasedBehavior (gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::String &oldBehaviorName, const gd::String &newBehaviorName)
 Refactor the project after a behavior is renamed.
 
static void ObjectOrGroupRenamedInLayout (gd::Project &project, gd::Layout &layout, const gd::String &oldName, const gd::String &newName, bool isObjectGroup)
 Refactor the project after an object is renamed in a layout. More...
 
static void ObjectOrGroupRemovedInLayout (gd::Project &project, gd::Layout &layout, const gd::String &objectName, bool isObjectGroup, bool removeEventsAndGroups=true)
 Refactor the project after an object is removed in a layout. More...
 
static void ObjectOrGroupRenamedInEventsFunction (gd::Project &project, gd::EventsFunction &eventsFunction, gd::ObjectsContainer &globalObjectsContainer, gd::ObjectsContainer &objectsContainer, const gd::String &oldName, const gd::String &newName, bool isObjectGroup)
 Refactor the events function after an object or group is renamed. More...
 
static void ObjectOrGroupRemovedInEventsFunction (gd::Project &project, gd::EventsFunction &eventsFunction, gd::ObjectsContainer &globalObjectsContainer, gd::ObjectsContainer &objectsContainer, const gd::String &objectName, bool isObjectGroup, bool removeEventsAndGroups=true)
 Refactor the events function after an object or group is renamed. More...
 
static void GlobalObjectOrGroupRenamed (gd::Project &project, const gd::String &oldName, const gd::String &newName, bool isObjectGroup)
 Refactor the project after a global object is renamed. More...
 
static void GlobalObjectOrGroupRemoved (gd::Project &project, const gd::String &objectName, bool isObjectGroup, bool removeEventsAndGroups=true)
 Refactor the project after a global object is removed. More...
 
static std::set< gd::StringGetAllObjectTypesUsingEventsBasedBehavior (const gd::Project &project, const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior)
 Return the set of all the types of the objects that are using the given behavior.
 
static void EnsureBehaviorEventsFunctionsProperParameters (const gd::EventsFunctionsExtension &eventsFunctionsExtension, const gd::EventsBasedBehavior &eventsBasedBehavior)
 Ensure (adding if necessary) that the functions of the given behavior have the proper mandatory parameters (the "Object" and "Behavior").
 

Detailed Description

Tool functions to do refactoring on the whole project after changes like deletion or renaming of an object.

Ideally ObjectOrGroupRenamedInLayout, ObjectOrGroupRemovedInLayout, GlobalObjectOrGroupRenamed, GlobalObjectOrGroupRemoved would be implemented using ExposeProjectEvents.

Member Function Documentation

void gd::WholeProjectRefactorer::ExposeProjectEvents ( gd::Project project,
gd::ArbitraryEventsWorker worker 
)
static

Call the specified worker on all events of the project (layout, external events, events functions...)

This should be the preferred way to traverse all the events of a project.

void gd::WholeProjectRefactorer::ExposeProjectEvents ( gd::Project project,
gd::ArbitraryEventsWorkerWithContext worker 
)
static

Call the specified worker on all events of the project (layout, external events, events functions...)

This should be the preferred way to traverse all the events of a project.

void gd::WholeProjectRefactorer::GlobalObjectOrGroupRemoved ( gd::Project project,
const gd::String objectName,
bool  isObjectGroup,
bool  removeEventsAndGroups = true 
)
static

Refactor the project after a global object is removed.

This will update all the layouts, all external layouts associated with them and all external events used by the layouts.

void gd::WholeProjectRefactorer::GlobalObjectOrGroupRenamed ( gd::Project project,
const gd::String oldName,
const gd::String newName,
bool  isObjectGroup 
)
static

Refactor the project after a global object is renamed.

This will update all the layouts, all external layouts associated with them and all external events used by the layouts.

void gd::WholeProjectRefactorer::ObjectOrGroupRemovedInEventsFunction ( gd::Project project,
gd::EventsFunction eventsFunction,
gd::ObjectsContainer globalObjectsContainer,
gd::ObjectsContainer objectsContainer,
const gd::String objectName,
bool  isObjectGroup,
bool  removeEventsAndGroups = true 
)
static

Refactor the events function after an object or group is renamed.

This will update the events of the function and groups.

void gd::WholeProjectRefactorer::ObjectOrGroupRemovedInLayout ( gd::Project project,
gd::Layout layout,
const gd::String objectName,
bool  isObjectGroup,
bool  removeEventsAndGroups = true 
)
static

Refactor the project after an object is removed in a layout.

This will update the layout, all external layouts associated with it and all external events used by the layout.

void gd::WholeProjectRefactorer::ObjectOrGroupRenamedInEventsFunction ( gd::Project project,
gd::EventsFunction eventsFunction,
gd::ObjectsContainer globalObjectsContainer,
gd::ObjectsContainer objectsContainer,
const gd::String oldName,
const gd::String newName,
bool  isObjectGroup 
)
static

Refactor the events function after an object or group is renamed.

This will update the events of the function and groups.

void gd::WholeProjectRefactorer::ObjectOrGroupRenamedInLayout ( gd::Project project,
gd::Layout layout,
const gd::String oldName,
const gd::String newName,
bool  isObjectGroup 
)
static

Refactor the project after an object is renamed in a layout.

This will update the layout, all external layouts associated with it and all external events used by the layout.


The documentation for this class was generated from the following files: