GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
ProjectElementRenamer.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #pragma once
7 
8 #include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
9 #include "GDCore/String.h"
10 #include <map>
11 #include <memory>
12 #include <vector>
13 
14 namespace gd {
15 class BaseEvent;
16 class Platform;
17 class EventsList;
18 } // namespace gd
19 
20 namespace gd {
21 
29 class GD_CORE_API ProjectElementRenamer
31 public:
32  ProjectElementRenamer(const gd::Platform &platform_,
33  const gd::String &parameterType_,
34  const gd::String &oldName_, const gd::String &newName_)
35  : platform(platform_), parameterType(parameterType_), oldName(oldName_),
36  newName(newName_){};
37  virtual ~ProjectElementRenamer();
38 
39  void SetObjectConstraint(const gd::String &objectName_) {
40  objectName = objectName_;
41  }
42 
43  void SetLayerConstraint(const gd::String &layerName_) {
44  layerName = layerName_;
45  }
46 
47 private:
48  bool DoVisitInstruction(gd::Instruction &instruction,
49  bool isCondition) override;
50 
51  const gd::Platform &platform;
52  const gd::String parameterType;
55  gd::String objectName;
58  gd::String layerName;
59  const gd::String oldName;
60  const gd::String newName;
61 };
62 
63 } // namespace gd
An events worker that will know about the context (the objects container). Useful for workers working...
Definition: ArbitraryEventsWorker.h:113
An instruction is a member of an event: It can be a condition or an action.
Definition: Instruction.h:30
Base class for implementing a platform.
Definition: Platform.h:42
Replace in expressions and in parameters of actions or conditions occurrences of project element name...
Definition: ProjectElementRenamer.h:30
String represents an UTF8 encoded string.
Definition: String.h:31
Definition: CommonTools.h:24