mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-19 08:23:28 +00:00
changed to string view
This commit is contained in:
@@ -31,7 +31,7 @@ namespace omath::pathfinding
|
|||||||
bool empty() const;
|
bool empty() const;
|
||||||
|
|
||||||
// Events -- per-vertex optional tag (e.g. "jump", "teleport")
|
// Events -- per-vertex optional tag (e.g. "jump", "teleport")
|
||||||
void set_event(const Vector3<float>& vertex, std::string event_id);
|
void set_event(const Vector3<float>& vertex, const std::string_view& event_id);
|
||||||
void clear_event(const Vector3<float>& vertex);
|
void clear_event(const Vector3<float>& vertex);
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ namespace omath::pathfinding
|
|||||||
return m_vertex_map.empty();
|
return m_vertex_map.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationMesh::set_event(const Vector3<float>& vertex, std::string event_id)
|
void NavigationMesh::set_event(const Vector3<float>& vertex, const std::string_view& event_id)
|
||||||
{
|
{
|
||||||
if (!m_vertex_map.contains(vertex))
|
if (!m_vertex_map.contains(vertex))
|
||||||
throw std::invalid_argument(std::format("Vertex '{}' not found", vertex));
|
throw std::invalid_argument(std::format("Vertex '{}' not found", vertex));
|
||||||
|
|
||||||
m_vertex_events[vertex] = std::move(event_id);
|
m_vertex_events[vertex] = event_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationMesh::clear_event(const Vector3<float>& vertex)
|
void NavigationMesh::clear_event(const Vector3<float>& vertex)
|
||||||
|
|||||||
Reference in New Issue
Block a user