Skip to content

Commit

Permalink
path: Path request class.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Mar 17, 2024
1 parent 00571de commit 8f9d9ca
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions libopenage/pathfinding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_sources(libopenage
grid.cpp
integration_field.cpp
integrator.cpp
path.cpp
pathfinder.cpp
portal.cpp
sector.cpp
Expand Down
10 changes: 10 additions & 0 deletions libopenage/pathfinding/path.cpp
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions libopenage/pathfinding/path.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2024-2024 the openage authors. See copying.md for legal info.

#pragma once

#include <vector>

#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<coord::tile> waypoints;
};

} // namespace openage::path

0 comments on commit 8f9d9ca

Please sign in to comment.