mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 21:03:27 +00:00
added events
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user