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