From 8f9d9ca08a3802c1695e9c74da3b53a975be0cca Mon Sep 17 00:00:00 2001 From: heinezen Date: Mon, 18 Mar 2024 00:29:18 +0100 Subject: [PATCH] path: Path request class. --- libopenage/pathfinding/CMakeLists.txt | 1 + libopenage/pathfinding/path.cpp | 10 ++++++++ libopenage/pathfinding/path.h | 34 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 libopenage/pathfinding/path.cpp create mode 100644 libopenage/pathfinding/path.h diff --git a/libopenage/pathfinding/CMakeLists.txt b/libopenage/pathfinding/CMakeLists.txt index ed55ffc4637..7f85264d01e 100644 --- a/libopenage/pathfinding/CMakeLists.txt +++ b/libopenage/pathfinding/CMakeLists.txt @@ -5,6 +5,7 @@ add_sources(libopenage grid.cpp integration_field.cpp integrator.cpp + path.cpp pathfinder.cpp portal.cpp sector.cpp diff --git a/libopenage/pathfinding/path.cpp b/libopenage/pathfinding/path.cpp new file mode 100644 index 00000000000..fe13989e77a --- /dev/null +++ b/libopenage/pathfinding/path.cpp @@ -0,0 +1,10 @@ +// Copyright 2024-2024 the openage authors. See copying.md for legal info. + +#include "path.h" + + +namespace openage::path { + +// this file is intentionally empty + +} // namespace openage::path diff --git a/libopenage/pathfinding/path.h b/libopenage/pathfinding/path.h new file mode 100644 index 00000000000..cb08e09991a --- /dev/null +++ b/libopenage/pathfinding/path.h @@ -0,0 +1,34 @@ +// Copyright 2024-2024 the openage authors. See copying.md for legal info. + +#pragma once + +#include + +#include "coord/tile.h" + + +namespace openage::path { + +/** + * Path request for the pathfinder. + */ +struct PathRequest { + // ID of the grid to use for pathfinding. + size_t grid_id; + // Start position of the path. + coord::tile start; + // Target position of the path. + coord::tile target; +}; + +/** + * Path found by the pathfinder. + */ +struct Path { + // ID of the grid to used for pathfinding. + size_t grid_id; + // Waypoints of the path. + std::vector waypoints; +}; + +} // namespace openage::path