// // Created by Vlad on 28.07.2024. // #pragma once #include "omath/linear_algebra/vector3.hpp" #include #include #include #include #include namespace omath::pathfinding { enum Error { }; class NavigationMesh final { public: [[nodiscard]] std::expected, std::string> get_closest_vertex(const Vector3& point) const noexcept; [[nodiscard]] const std::vector>& get_neighbors(const Vector3& vertex) const noexcept; [[nodiscard]] bool empty() const; // Events -- per-vertex optional tag (e.g. "jump", "teleport") void set_event(const Vector3& vertex, const std::string_view& event_id); void clear_event(const Vector3& vertex); [[nodiscard]] std::optional get_event(const Vector3& vertex) const noexcept; [[nodiscard]] std::string serialize() const noexcept; void deserialize(const std::string& raw); std::unordered_map, std::vector>> m_vertex_map; private: std::unordered_map, std::string> m_vertex_events; }; } // namespace omath::pathfinding