Files
GDevelop/Extensions/PathfindingBehavior/ScenePathfindingObstaclesManager.h
T
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00

53 lines
1.4 KiB
C++

/**
GDevelop - Pathfinding Behavior Extension
Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#ifndef SCENEPLATFORMOBJECTSMANAGER_H
#define SCENEPLATFORMOBJECTSMANAGER_H
#include <map>
#include <set>
#include "GDCpp/Runtime/RuntimeScene.h"
class PathfindingObstacleBehavior;
/**
* \brief Contains lists of all obstacle related objects of a scene.
*/
class ScenePathfindingObstaclesManager {
public:
/**
* \brief Map containing, for each RuntimeScene, its associated
* ScenePathfindingObstaclesManager.
*/
static std::map<RuntimeScene*, ScenePathfindingObstaclesManager> managers;
ScenePathfindingObstaclesManager(){};
virtual ~ScenePathfindingObstaclesManager();
/**
* \brief Notify the manager that there is a new obstacle on the scene.
* \param obstacle The new obstacle
*/
void AddObstacle(PathfindingObstacleBehavior* obstacle);
/**
* \brief Notify the manager that a obstacle was removed from the scene.
* \param obstacle The removed obstacle
*/
void RemoveObstacle(PathfindingObstacleBehavior* obstacle);
/**
* \brief Get a read only access to the list of all obstacles
*/
const std::set<PathfindingObstacleBehavior*>& GetAllObstacles() const {
return allObstacles;
}
private:
std::set<PathfindingObstacleBehavior*>
allObstacles; ///< The list of all obstacles of the scene.
};
#endif