2018-08-26 20:27:38 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
|
|
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
|
|
|
|
|
2018-09-22 15:36:57 +00:00
|
|
|
#include "objectid.hpp"
|
2018-09-30 22:33:25 +00:00
|
|
|
#include "offmeshconnection.hpp"
|
2018-08-26 20:27:38 +00:00
|
|
|
#include "settings.hpp"
|
|
|
|
#include "tileposition.hpp"
|
|
|
|
|
2018-09-29 19:57:41 +00:00
|
|
|
#include <components/misc/guarded.hpp>
|
|
|
|
|
2018-08-26 20:27:38 +00:00
|
|
|
#include <map>
|
2020-06-11 21:23:30 +00:00
|
|
|
#include <set>
|
2018-08-26 20:27:38 +00:00
|
|
|
#include <unordered_set>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
class OffMeshConnectionsManager
|
|
|
|
{
|
|
|
|
public:
|
2021-11-06 12:46:43 +00:00
|
|
|
explicit OffMeshConnectionsManager(const RecastSettings& settings);
|
2018-08-26 20:27:38 +00:00
|
|
|
|
2021-06-27 14:22:30 +00:00
|
|
|
void add(const ObjectId id, const OffMeshConnection& value);
|
2018-08-26 20:27:38 +00:00
|
|
|
|
2021-06-27 14:22:30 +00:00
|
|
|
std::set<TilePosition> remove(const ObjectId id);
|
2021-02-03 23:14:29 +00:00
|
|
|
|
2021-06-29 01:49:21 +00:00
|
|
|
std::vector<OffMeshConnection> get(const TilePosition& tilePosition) const;
|
2018-08-26 20:27:38 +00:00
|
|
|
|
|
|
|
private:
|
2018-09-29 19:57:41 +00:00
|
|
|
struct Values
|
|
|
|
{
|
2020-06-11 21:23:30 +00:00
|
|
|
std::multimap<ObjectId, OffMeshConnection> mById;
|
2018-09-29 19:57:41 +00:00
|
|
|
std::map<TilePosition, std::unordered_set<ObjectId>> mByTilePosition;
|
|
|
|
};
|
|
|
|
|
2021-11-06 12:46:43 +00:00
|
|
|
const RecastSettings& mSettings;
|
2018-09-29 19:57:41 +00:00
|
|
|
Misc::ScopeGuarded<Values> mValues;
|
2018-08-26 20:27:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|