GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
LeaderboardIdRenamer.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 #include <map>
9 
10 #include "GDCore/IDE/Project/ArbitraryObjectsWorker.h"
11 #include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
12 #include "GDCore/String.h"
13 
14 namespace gd {
15 class Object;
16 class Behavior;
17 } // namespace gd
18 
19 namespace gd {
20 
22  public:
23  LeaderboardIdRenamer(gd::Project& project_): project(project_) {};
24  virtual ~LeaderboardIdRenamer();
25 
29  void SetLeaderboardIdsToReplace(const std::map<gd::String, gd::String>& leaderboardIdMap_) {
30  leaderboardIdMap = leaderboardIdMap_;
31  }
32 
36  const std::set<gd::String>& GetAllLeaderboardIds() const {
37  return allLeaderboardIds;
38  }
39 
40  private:
41  bool DoVisitInstruction(gd::Instruction& instruction, bool isCondition) override;
42  void DoVisitObject(gd::Object& object) override;
43  void DoVisitBehavior(gd::Behavior& behavior) override;
44 
45  std::map<gd::String, gd::String> leaderboardIdMap;
46  std::set<gd::String> allLeaderboardIds;
47  gd::Project& project;
48 };
49 
50 }; // namespace gd
ArbitraryEventsWorker is an abstract class used to browse events (and instructions) and do some work ...
Definition: ArbitraryEventsWorker.h:111
ArbitraryObjectsWorker is an abstract class used to browse objects (and behaviors) and do some work o...
Definition: ArbitraryObjectsWorker.h:30
Base class used to represents a behavior that can be applied to an object. It stores the content (i....
Definition: Behavior.h:23
An instruction is a member of an event: It can be a condition or an action.
Definition: Instruction.h:30
Definition: LeaderboardIdRenamer.h:21
void SetLeaderboardIdsToReplace(const std::map< gd::String, gd::String > &leaderboardIdMap_)
Definition: LeaderboardIdRenamer.h:29
const std::set< gd::String > & GetAllLeaderboardIds() const
Definition: LeaderboardIdRenamer.h:36
Represent an object of a platform.
Definition: Object.h:37
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
Definition: CommonTools.h:24