GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
DependenciesAnalyzer.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 #if defined(GD_IDE_ONLY)
7 #ifndef DEPENDENCIESANALYZER_H
8 #define DEPENDENCIESANALYZER_H
9 #include <memory>
10 #include <set>
11 #include <string>
12 #include <vector>
13 #include "GDCore/String.h"
14 namespace gd {
15 class EventsList;
16 }
17 namespace gd {
18 class BaseEvent;
19 }
20 namespace gd {
21 class Project;
22 }
23 namespace gd {
24 class Layout;
25 }
26 namespace gd {
27 class ExternalEvents;
28 }
29 
33 class GD_CORE_API DependenciesAnalyzer {
34  public:
38  DependenciesAnalyzer(const gd::Project& project_, const gd::Layout& layout_);
39 
43  DependenciesAnalyzer(const gd::Project& project_,
44  const gd::ExternalEvents& externalEvents);
45 
46  virtual ~DependenciesAnalyzer();
47 
56  bool Analyze();
57 
62  const std::set<gd::String>& GetScenesDependencies() const {
63  return scenesDependencies;
64  };
65 
70  const std::set<gd::String>& GetExternalEventsDependencies() const {
71  return externalEventsDependencies;
72  };
73 
74  private:
83  bool Analyze(const gd::EventsList& events);
84 
85  std::set<gd::String> scenesDependencies;
86  std::set<gd::String> externalEventsDependencies;
87  std::vector<gd::String>
88  parentScenes;
89  std::vector<gd::String>
90  parentExternalEvents;
91 
92  const gd::Project& project;
93  const gd::Layout* layout;
94  const gd::ExternalEvents* externalEvents;
95 };
96 
97 #endif // DEPENDENCIESANALYZER_H
98 #endif
Compute the dependencies of a scene or external events.
Definition: DependenciesAnalyzer.h:33
const std::set< gd::String > & GetScenesDependencies() const
Return the scenes being dependencies of the scene or external events passed in the constructor.
Definition: DependenciesAnalyzer.h:62
const std::set< gd::String > & GetExternalEventsDependencies() const
Return the external events being dependencies of the scene or external events passed in the construct...
Definition: DependenciesAnalyzer.h:70
A list of events.
Definition: EventsList.h:32
Contains a list of events not directly linked to a layout.
Definition: ExternalEvents.h:31
Represent a layout ( also called a scene ) of a project.
Definition: Layout.h:40
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:50
Definition: CommonTools.h:24