Loading...
Searching...
No Matches
CityBuilderCore.StructurePaths Class Reference

Detailed Description

manages the different variants of mag grid pathing for DefaultStructureManager
there is only one variant if there are no special StructurePathOptions defined

Inheritance diagram for CityBuilderCore.StructurePaths:
CityBuilderCore.IMapGridPathfinder CityBuilderCore.IMapGridLinker CityBuilderCore.IPathfinder CityBuilderCore.IGridLinker

Public Member Functions

void Initialize (GridPathfindingSettings pathfindingSettings, StructurePathOption[] options)
 
void Dispose ()
 
void Add (Vector2Int point)
 
void CheckPoints (IStructureManager manager, IEnumerable< Vector2Int > points)
 
void Calculate (int maxCalculations=PathQuery.DEFAULT_MAX_CALCULATIONS)
 
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 RegisterLink (IGridLink link, object tag)
 adds a link to the linker
 
void DeregisterLink (IGridLink link, object tag)
 removes a link from the linker
 
IEnumerable< IGridLinkGetLinks (Vector2Int start, object tag)
 retrieves all links starting at a specific point
 
IGridLink GetLink (Vector2Int start, Vector2Int end, object tag)
 retrieves a link connecting two specific points if one exists
 

Member Function Documentation

◆ DeregisterLink()

void CityBuilderCore.StructurePaths.DeregisterLink ( IGridLink link,
object tag )
inline

removes a link from the linker

Parameters
linkthe link to be removed
tagadditional information, for example the Road when the link should be removed to a specific road network

Implements CityBuilderCore.IGridLinker.

◆ FindPath()

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

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.StructurePaths.FindPathQuery ( Vector2Int[] starts,
Vector2Int[] targets,
object tag = null )

◆ GetLink()

IGridLink CityBuilderCore.StructurePaths.GetLink ( Vector2Int start,
Vector2Int end,
object tag )

retrieves a link connecting two specific points if one exists

Parameters
startstart point of the potential link
endend point of the potential link
tagadditional parameter
Returns

Implements CityBuilderCore.IGridLinker.

◆ GetLinks()

IEnumerable< IGridLink > CityBuilderCore.StructurePaths.GetLinks ( Vector2Int start,
object tag )

retrieves all links starting at a specific point

Parameters
startthe point at which to look for lniks
tagadditional parameter
Returns

Implements CityBuilderCore.IGridLinker.

◆ HasPoint()

bool CityBuilderCore.StructurePaths.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

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

Implements CityBuilderCore.IPathfinder.

◆ RegisterLink()

void CityBuilderCore.StructurePaths.RegisterLink ( IGridLink link,
object tag )
inline

adds a link to the linker

Parameters
linkthe link to be added
tagadditional information, for example the Road when the link should be added to a specific road network

Implements CityBuilderCore.IGridLinker.