1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-31 18:15:01 +00:00
OpenMW/components/detournavigator/offmeshconnectionsmanager.hpp
2022-09-22 21:35:26 +03:00

42 lines
1.0 KiB
C++

#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
#include "objectid.hpp"
#include "offmeshconnection.hpp"
#include "settings.hpp"
#include "tileposition.hpp"
#include <components/misc/guarded.hpp>
#include <map>
#include <set>
#include <unordered_set>
#include <vector>
namespace DetourNavigator
{
class OffMeshConnectionsManager
{
public:
explicit OffMeshConnectionsManager(const RecastSettings& settings);
void add(const ObjectId id, const OffMeshConnection& value);
std::set<TilePosition> remove(const ObjectId id);
std::vector<OffMeshConnection> get(const TilePosition& tilePosition) const;
private:
struct Values
{
std::multimap<ObjectId, OffMeshConnection> mById;
std::map<TilePosition, std::unordered_set<ObjectId>> mByTilePosition;
};
const RecastSettings& mSettings;
Misc::ScopeGuarded<Values> mValues;
};
}
#endif