added events

This commit is contained in:
2026-03-11 14:19:58 +03:00
parent 93fc93d4f6
commit 1d54039f57
3 changed files with 145 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
#include "omath/linear_algebra/vector3.hpp"
#include <expected>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
@@ -29,10 +30,20 @@ namespace omath::pathfinding
[[nodiscard]]
bool empty() const;
// Events -- per-vertex optional tag (e.g. "jump", "teleport")
void set_event(const Vector3<float>& vertex, std::string event_id);
void clear_event(const Vector3<float>& vertex);
[[nodiscard]]
std::optional<std::string> get_event(const Vector3<float>& vertex) const noexcept;
[[nodiscard]] std::string serialize() const noexcept;
void deserialize(const std::string& raw);
std::unordered_map<Vector3<float>, std::vector<Vector3<float>>> m_vertex_map;
private:
std::unordered_map<Vector3<float>, std::string> m_vertex_events;
};
} // namespace omath::pathfinding