GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
ArbitraryBehaviorSharedDataWorker.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 
7 #pragma once
8 
9 #include <map>
10 #include <memory>
11 #include <vector>
12 
13 #include "GDCore/String.h"
14 #include "GDCore/Tools/SerializableWithNameList.h"
15 
16 namespace gd {
17 class BehaviorsSharedData;
18 } // namespace gd
19 
20 namespace gd {
21 
30  public:
33 
37  void Launch(const std::map<gd::String, std::unique_ptr<gd::BehaviorsSharedData>>& sharedDatas) { VisitSharedDatas(sharedDatas); };
38 
39  private:
40  void VisitSharedDatas(const std::map<gd::String, std::unique_ptr<gd::BehaviorsSharedData>>& sharedDatas);
41  void VisitSharedData(gd::BehaviorsSharedData& behavior);
42 
46  virtual void DoVisitSharedDatas(const std::map<gd::String, std::unique_ptr<gd::BehaviorsSharedData>>& sharedDatas){};
47 
51  virtual void DoVisitSharedData(gd::BehaviorsSharedData& sharedData){};
52 };
53 
54 } // namespace gd
55 
ArbitraryBehaviorSharedDataWorker is an abstract class used to browse shared data and do some work on...
Definition: ArbitraryBehaviorSharedDataWorker.h:29
void Launch(const std::map< gd::String, std::unique_ptr< gd::BehaviorsSharedData >> &sharedDatas)
Launch the worker on the specified shared data.
Definition: ArbitraryBehaviorSharedDataWorker.h:37
Base class for defining data shared by behaviors having the same type and name.
Definition: BehaviorsSharedData.h:24
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24