Loading...
Searching...
No Matches
CityBuilderCore.GridPathfindingBase Class Referenceabstract
Inheritance diagram for CityBuilderCore.GridPathfindingBase:
CityBuilderCore.IRoadPathfinder CityBuilderCore.IRoadPathfinderBlocked CityBuilderCore.IMapGridPathfinder CityBuilderCore.IPathfinder CityBuilderCore.IPathfinder CityBuilderCore.IPathfinder CityBuilderCore.GridPathfinding CityBuilderCore.GridPathfindingBurst

Public Member Functions

void Calculate (int maxCalculations=PathQuery.DEFAULT_MAX_CALCULATIONS)
 
virtual void Add (IEnumerable< Vector2Int > points)
 
void Add (Vector2Int point)
 
virtual void Remove (IEnumerable< Vector2Int > points)
 
void Remove (Vector2Int point)
 
void Clear ()
 
void AddLink (IGridLink link)
 
void RemoveLink (IGridLink link)
 
void AddSwitch (Vector2Int point, GridPathfindingBase pathfinding)
 
void AddSwitch (Vector2Int entry, Vector2Int point, Vector2Int exit, GridPathfindingBase pathfinding)
 
void BlockTags (IEnumerable< Vector2Int > points, IEnumerable< object > tags)
 
void UnblockTags (IEnumerable< Vector2Int > points, IEnumerable< object > tags)
 
IEnumerable< Vector2Int > GetPoints ()
 
bool HasPoint (Vector2Int point, object tag=null)
 checks if a point exists within the pathfinder
for example points on map pathing that are blocked or points for road pathing that dont have a road
 
WalkingPath FindPath (Vector2Int[] starts, Vector2Int[] targets, object tag=null)
 attempts to find a path between one of the starts and one of the ends
 
PathQuery FindPathQuery (Vector2Int[] starts, Vector2Int[] targets, object tag=null)
 
void Dispose ()
 

Static Public Attributes

const int COSTH = 10
 
const int COSTD = 14
 

Properties

bool AllowDiagonal [get, set]
 
bool AllowInvalid [get, set]
 

Member Function Documentation

◆ FindPath()

WalkingPath CityBuilderCore.GridPathfindingBase.FindPath ( Vector2Int[] starts,
Vector2Int[] targets,
object tag = null )
abstract

attempts to find a path between one of the starts and one of the ends

Parameters
startscollection of one or more possible start points
targetscollection of one or more possible start points
tagadditional pathfinding parameter(road type, walker info, ...)
Returns
the calculated path or null when no path was found

Implements CityBuilderCore.IPathfinder.

◆ FindPathQuery()

PathQuery CityBuilderCore.GridPathfindingBase.FindPathQuery ( Vector2Int[] starts,
Vector2Int[] targets,
object tag = null )
abstract

◆ HasPoint()

bool CityBuilderCore.GridPathfindingBase.HasPoint ( Vector2Int point,
object tag = null )
abstract

checks if a point exists within the pathfinder
for example points on map pathing that are blocked or points for road pathing that dont have a road

Parameters
pointthe map point to check
tagadditional pathfinding parameter(road type, walker info, ...)
Returns
whether the point exists in the pathfinder

Implements CityBuilderCore.IPathfinder.