Loading...
Searching...
No Matches
CityBuilderCore.IGridLink Interface Reference

Detailed Description

links two points on the map or a road network
registered with a IGridLinker so it can be found and added to pathfinding
when a walker actually moves across it control is handed to the link

Inheritance diagram for CityBuilderCore.IGridLink:
CityBuilderCore.OffGridLink CityBuilderCore.ExpandableOffGridLink

Public Member Functions

void Walk (Walker walker, float moved, Vector2Int start)
 walker movement is done here while a walker is traversing a link
this can be used to move walkers in atypical ways
for example when moving up ramps or across bridges
 

Properties

Vector2Int StartPoint [get]
 start point of the link, if it changes the link has to be reregistered
 
Vector2Int EndPoint [get]
 end point of the link, if it changes the link has to be reregistered
 
bool Bidirectional [get]
 whether walkers can also move from end to start
 
int Cost [get]
 cost of traversing the link in pathfinding, by default moving 1 point has cost 10
 
float Distance [get]
 length of the link when a walker moves through it, longer distance can make the walker slower
 

Member Function Documentation

◆ Walk()

void CityBuilderCore.IGridLink.Walk ( Walker walker,
float moved,
Vector2Int start )

walker movement is done here while a walker is traversing a link
this can be used to move walkers in atypical ways
for example when moving up ramps or across bridges

Parameters
walkerthe walker moving across the link
movedhow much the walker has already moved
startthe point the walker started at, relevant in bidirectional links

Implemented in CityBuilderCore.ExpandableOffGridLink, and CityBuilderCore.OffGridLink.

Property Documentation

◆ EndPoint

Vector2Int CityBuilderCore.IGridLink.EndPoint
get

end point of the link, if it changes the link has to be reregistered

Implemented in CityBuilderCore.OffGridLink.

◆ StartPoint

Vector2Int CityBuilderCore.IGridLink.StartPoint
get

start point of the link, if it changes the link has to be reregistered

Implemented in CityBuilderCore.OffGridLink.