18#ifndef INCLUDED_ICMPPATHFINDER
19#define INCLUDED_ICMPPATHFINDER
37template<
typename T>
class Grid;
75 std::map<std::string, pass_class_t>& nonPathfindingPassClasses,
76 std::map<std::string, pass_class_t>& pathfindingPassClasses)
const = 0;
std::uint16_t pass_class_t
Definition: Pathfinding.h:33
Definition: FixedVector2D.h:25
A simple fixed-point number class.
Definition: Fixed.h:129
Basic 2D array, intended for storing tile data, plus support for lazy updates by ICmpObstructionManag...
Definition: Grid.h:46
EFoundationCheck
Definition: ICmpObstruction.h:42
Pathfinder algorithms.
Definition: ICmpPathfinder.h:63
virtual void FlushAIPathfinderDirtinessInformation()=0
virtual std::uint32_t ComputeShortPathAsync(entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal &goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify)=0
Request a short path computation, asynchronously.
virtual void SetDebugPath(entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass)=0
If the debug overlay is enabled, render the path that will computed by ComputePath.
virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const =0
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain.
virtual void GetDebugData(std::uint32_t &steps, double &time, Grid< std::uint8_t > &grid) const =0
Returns some stats about the last ComputePath.
virtual std::vector< CFixedVector2D > DistributeAround(std::vector< entity_id_t > units, entity_pos_t x, entity_pos_t z) const =0
Distribute units around a point, returning a list of positions.
virtual bool CheckMovement(const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const =0
Check whether the given movement line is valid and doesn't hit any obstructions or impassable terrain...
virtual Grid< std::uint16_t > ComputeShoreGrid(bool expandOnWater=false)=0
Get a grid representing the distance to the shore of the terrain tile.
virtual WaypointPath ComputeShortPathImmediate(const ShortPathRequest &request) const =0
virtual bool IsGoalReachable(entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass)=0
virtual const GridUpdateInformation & GetAIPathfinderDirtinessInformation() const =0
Get the accumulated dirtiness information since the last time the AI accessed and flushed it.
virtual void SetDebugOverlay(bool enabled)=0
Toggle the storage and rendering of debug info.
virtual entity_pos_t GetMaximumClearance() const =0
Get the larger clearance in all passability classes.
virtual void SetHierDebugOverlay(bool enabled)=0
Toggle the storage and rendering of debug info for the hierarchical pathfinder.
virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const =0
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain.
virtual const Grid< NavcellData > & GetPassabilityGrid()=0
virtual void SetAtlasOverlay(bool enable, pass_class_t passClass=0)=0
Sets up the pathfinder passability overlay in Atlas.
virtual void GetPassabilityClasses(std::map< std::string, pass_class_t > &nonPathfindingPassClasses, std::map< std::string, pass_class_t > &pathfindingPassClasses) const =0
Get the list of passability classes, separating pathfinding classes and others.
virtual pass_class_t GetPassabilityClass(const std::string &name) const =0
Get the tag for a given passability class name.
virtual entity_pos_t GetClearance(pass_class_t passClass) const =0
virtual void SendRequestedPaths()=0
Finish computing asynchronous path requests and send the CMessagePathResult messages.
virtual void StartProcessingMoves(bool useMax)=0
Tell asynchronous pathfinder threads that they can begin computing paths.
virtual void UpdateGrid()=0
Regenerates the grid based on the current obstruction list, if necessary.
virtual std::uint32_t ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass, entity_id_t notify)=0
Asynchronous version of ComputePath.
virtual void GetPassabilityClasses(std::map< std::string, pass_class_t > &passClasses) const =0
Get the list of all known passability classes.
virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint=false) const =0
Check whether a unit placed here is valid and doesn't hit any obstructions or impassable terrain.
virtual void ComputePathImmediate(entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass, WaypointPath &ret) const =0
Definition: IComponent.h:33
Interface for ICmpObstructionManager Test functions to filter out unwanted shapes.
Definition: ICmpObstructionManager.h:357
Pathfinder goal.
Definition: PathGoal.h:34
std::uint32_t entity_id_t
Entity ID type.
Definition: Entity.h:29
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23
Definition: ICmpPathfinder.h:40
entity_id_t notify
Definition: ICmpPathfinder.h:45
WaypointPath path
Definition: ICmpPathfinder.h:46
std::uint32_t ticket
Definition: ICmpPathfinder.h:44
PathResult(std::uint32_t t, entity_id_t n, WaypointPath p)
Definition: ICmpPathfinder.h:42
Definition: Pathfinding.h:46
Returned path.
Definition: Pathfinding.h:69