mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 09:19:55 +00:00
c68cecb1eb
Optimize off mesh connections See merge request OpenMW/openmw!969 (cherry picked from commit 9dcea247d2cd7d25d719fabc142cef5360233e2a) 3e98db8d Fix styleguide 7f65a2c4 Remove unused code 81e569c3 Move OffMeshConnectionsManager implementation into cpp a8ba9a0e Cleanup unused tile positions from OffMeshConnectionsManager ff1af5e8 Use only off mesh connections starting or ending in a given tile 1552e7e3 Add pathgrid edges as one direction off mesh connection
41 lines
1,014 B
C++
41 lines
1,014 B
C++
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTIONSMANAGER_H
|
|
|
|
#include "settings.hpp"
|
|
#include "tileposition.hpp"
|
|
#include "objectid.hpp"
|
|
#include "offmeshconnection.hpp"
|
|
|
|
#include <components/misc/guarded.hpp>
|
|
|
|
#include <map>
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
#include <set>
|
|
|
|
namespace DetourNavigator
|
|
{
|
|
class OffMeshConnectionsManager
|
|
{
|
|
public:
|
|
OffMeshConnectionsManager(const Settings& settings);
|
|
|
|
void add(const ObjectId id, const OffMeshConnection& value);
|
|
|
|
std::set<TilePosition> remove(const ObjectId id);
|
|
|
|
std::vector<OffMeshConnection> get(const TilePosition& tilePosition);
|
|
|
|
private:
|
|
struct Values
|
|
{
|
|
std::multimap<ObjectId, OffMeshConnection> mById;
|
|
std::map<TilePosition, std::unordered_set<ObjectId>> mByTilePosition;
|
|
};
|
|
|
|
const Settings& mSettings;
|
|
Misc::ScopeGuarded<Values> mValues;
|
|
};
|
|
}
|
|
|
|
#endif
|