Files
GDevelop/Extensions/LinkedObjects/ObjectsLinksManager.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

64 lines
1.3 KiB
C++

/**
GDevelop - LinkedObjects Extension
Copyright (c) 2011-2013 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#ifndef OBJECTSLINKSMANAGER_H
#define OBJECTSLINKSMANAGER_H
#include <map>
#include <set>
#include <string>
#include <vector>
class RuntimeObject;
class RuntimeScene;
namespace GDpriv {
namespace LinkedObjects {
/**
* \brief Manage links between objects of a scene
*/
class GD_EXTENSION_API ObjectsLinksManager {
public:
/**
* \brief Link two object
*/
void LinkObjects(RuntimeObject* a, RuntimeObject* b);
/**
* \brief Remove link between a and b
*/
void RemoveLinkBetween(RuntimeObject* a, RuntimeObject* b);
/**
* \brief Remove all links concerning the object
*/
void RemoveAllLinksOf(RuntimeObject* object);
/**
* \brief Get a list of (raw pointers to) all objects linked with the
* specified object
*/
std::vector<RuntimeObject*> GetObjectsLinkedWith(RuntimeObject* object);
/**
* \brief Delete all links
*/
void ClearAll();
static std::map<RuntimeScene*, ObjectsLinksManager>
managers; // List of managers associated with scenes.
private:
std::map<RuntimeObject*, std::set<RuntimeObject*> > links;
};
} // namespace LinkedObjects
} // namespace GDpriv
#endif // OBJECTSLINKSMANAGER_H