mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-23 02:25:52 -04:00
a8559bfbbc
* 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
64 lines
1.3 KiB
C++
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
|