1 #ifndef PATHFINDING_HPP_INCLUDED
2 #define PATHFINDING_HPP_INCLUDED
4 #include "../../Core/Types/Tile.hpp"
80 Tile ToWorldTile(std::int32_t ClientX, std::int32_t ClientY, std::int32_t ClientPlane)
const;
82 operator bool()
const;
124 std::vector<Pathfinding::TileNode>
FindNodePathTo(
const std::vector<Tile>& Goals,
132 std::vector<Pathfinding::TileNode*>
GetNeighborsTo(std::int32_t X, std::int32_t Y,
bool CheckCollision =
true);
133 std::vector<Pathfinding::TileNode>
Finder_BFS(std::uint32_t StartX, std::uint32_t StartY, std::uint32_t EndX, std::uint32_t EndY, std::int32_t
Options );
134 std::vector<Pathfinding::TileNode>
Finder_BFS(std::uint32_t StartX, std::uint32_t StartY,
const std::vector<std::pair<std::uint32_t, std::uint32_t>>& Ends, std::int32_t
Options );
A subclass used to store information about tile nodes generated by the Pathfinding class.
std::int32_t Y
The local region Y coordinate.
bool MatchesBlacklist
True if this node matches the blacklisted tiles set in Pathfinding
bool operator==(const TileNode &N) const
Tile ToWorldTile() const
Adds ClientX/Y to the local X and Y coordinates of the node, returning a world tile
bool IsBlocked() const
True if the node is occupied or blocked according to its collision flag.
Tile ToWorldTile(std::int32_t ClientX, std::int32_t ClientY, std::int32_t ClientPlane) const
Adds ClientX/Y to the local X and Y coordinates of the node, returning a world tile
std::int32_t X
The local region X coordinate.
std::int32_t Flag
The collision flag associated with the node.
bool Inspected
For pathfinding use only
TileNode(std::int32_t X, std::int32_t Y, std::int32_t Flag)
bool MatchesWhitelist
True if this node matches the whitelisted tiles set in Pathfinding
std::int32_t Parent[2]
For pathfinding use only
A class allowing easy pathfinding within the local region.
void SetWhitelist(const std::vector< Tile > &W)
Sets the internal Whitelist tiles.
std::vector< Pathfinding::TileNode > FindNodePathTo(const Tile &Goal, std::int32_t Options=CHECK_COLLISION|CHECK_WHITELIST|CHECK_BLACKLIST, PATHFINDER Finder=BREADTH_FIRST_SEARCH)
void SetBlacklist(const std::vector< Tile > &B)
Sets the internal Blacklist tiles.
std::vector< Tile > FindPathTo(const Tile &Goal, std::int32_t Options=CHECK_COLLISION|CHECK_WHITELIST|CHECK_BLACKLIST, PATHFINDER Finder=BREADTH_FIRST_SEARCH)
std::int32_t GetCurrentRegion()
Returns the region ID the local player is in.
std::vector< Tile > GetBlacklist()
Returns the internal Blacklist cache.
Tile FindWalkableTile(const Tile &T)
std::vector< std::vector< TileNode > > GetNodes()
Returns the internal TileNode cache generated by GenerateNodes()
void GenerateNodes()
Clears the internal cached nodes, and generates new ones based on the local region
std::vector< Pathfinding::TileNode * > GetNeighborsTo(std::int32_t X, std::int32_t Y, bool CheckCollision=true)
std::vector< Tile > FindWalkableTiles(const Tile &T)
std::vector< Pathfinding::TileNode > Finder_BFS(std::uint32_t StartX, std::uint32_t StartY, std::uint32_t EndX, std::uint32_t EndY, std::int32_t Options)
bool IsInside(std::int32_t X, std::int32_t Y)
std::vector< Tile > GetWhitelist()
Returns the internal Whitelist cache.