Loading...
Searching...
No Matches
CityBuilderCore.RoadManagerBaseMulti Class Referenceabstract

Detailed Description

base class for road managers that can create seperate road networks for different Roads
it also creates a combined road network for walkers which do not specifiy which road they can walk on
the kind of Road a walker can walk on is specified in WalkerInfo.PathTag
the base class provides all the plumbing between the networks and the manager
the implementations have to provide the actual RoadNetworks which determines how roads are visualized

https://citybuilder.softleitner.com/manual/walkers

Inheritance diagram for CityBuilderCore.RoadManagerBaseMulti:
CityBuilderCore.IRoadManager CityBuilderCore.IRoadPathfinder CityBuilderCore.IRoadGridLinker CityBuilderCore.ISaveData CityBuilderCore.IPathfinder CityBuilderCore.IGridLinker CityBuilderCore.MultiRoadManager

Classes

class  MultiRoadsData
 

Public Member Functions

bool HasPoint (Vector2Int point, Road road=null)
 
void Add (IEnumerable< Vector2Int > points, Road road)
 
void Register (IEnumerable< Vector2Int > points, Road road)
 
void Deregister (IEnumerable< Vector2Int > points, Road road)
 
void RegisterSwitch (Vector2Int point, Road roadEntry, Road roadExit)
 
void RegisterSwitch (Vector2Int entry, Vector2Int point, Vector2Int exit, Road roadEntry, Road roadExit)
 
void Block (IEnumerable< Vector2Int > points, Road road=null)
 
void Unblock (IEnumerable< Vector2Int > points, Road road=null)
 
void BlockTags (IEnumerable< Vector2Int > points, IEnumerable< object > tags, Road road=null)
 
void UnblockTags (IEnumerable< Vector2Int > points, IEnumerable< object > tags, Road road=null)
 
void Remove (IEnumerable< Vector2Int > points)
 
IEnumerable< Vector2Int > GetPoints ()
 
bool HasPoint (Vector2Int point)
 
void CheckLayers (IEnumerable< Vector2Int > points)
 
bool CheckRequirement (Vector2Int point, RoadRequirement requirement)
 
string GetName ()
 
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
 
bool HasPointBlocked (Vector2Int point, object tag=null)
 
WalkingPath FindPath (Vector2Int[] starts, Vector2Int[] targets, object tag)
 attempts to find a path between one of the starts and one of the ends
 
WalkingPath FindPathBlocked (Vector2Int[] starts, Vector2Int[] targets, object tag)
 
PathQuery FindPathQuery (Vector2Int[] starts, Vector2Int[] targets, object tag)
 
PathQuery FindPathQueryBlocked (Vector2Int[] starts, Vector2Int[] targets, object tag)
 
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
 
string SaveData ()
 serializes the objects state(usually to json) and returns it
 
void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 

Public Attributes

GridPathfindingSettings PathfindingSettings
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void Update ()
 
virtual void OnDestroy ()
 
Dictionary< Road, RoadNetworkcreateNetworks ()
 

Properties

bool IsDestructible [get]
 
bool IsDecorator [get]
 
bool IsWalkable [get]
 
bool IsAllowedOnRoads [get]
 
Transform Root [get]
 
StructureReference StructureReference [get, set]
 

Events

Action< PointsChanged< IStructure > > PositionsChanged
 

Member Function Documentation

◆ Add()

void CityBuilderCore.RoadManagerBaseMulti.Add ( IEnumerable< Vector2Int > points,
Road road )
inline

◆ Block()

void CityBuilderCore.RoadManagerBaseMulti.Block ( IEnumerable< Vector2Int > points,
Road road = null )
inline

◆ BlockTags()

void CityBuilderCore.RoadManagerBaseMulti.BlockTags ( IEnumerable< Vector2Int > points,
IEnumerable< object > tags,
Road road = null )
inline

◆ CheckRequirement()

bool CityBuilderCore.RoadManagerBaseMulti.CheckRequirement ( Vector2Int point,
RoadRequirement requirement )
inline

◆ Deregister()

void CityBuilderCore.RoadManagerBaseMulti.Deregister ( IEnumerable< Vector2Int > points,
Road road )
inline

◆ DeregisterLink()

void CityBuilderCore.RoadManagerBaseMulti.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.RoadManagerBaseMulti.FindPath ( Vector2Int[] starts,
Vector2Int[] targets,
object tag )

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

◆ GetLink()

IGridLink CityBuilderCore.RoadManagerBaseMulti.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.RoadManagerBaseMulti.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.RoadManagerBaseMulti.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.

◆ LoadData()

void CityBuilderCore.RoadManagerBaseMulti.LoadData ( string json)
inline

deserializes the serialized json data and loads the data as its new state

Parameters
json

Implements CityBuilderCore.ISaveData.

◆ Register()

void CityBuilderCore.RoadManagerBaseMulti.Register ( IEnumerable< Vector2Int > points,
Road road )
inline

◆ RegisterLink()

void CityBuilderCore.RoadManagerBaseMulti.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.

◆ RegisterSwitch() [1/2]

void CityBuilderCore.RoadManagerBaseMulti.RegisterSwitch ( Vector2Int entry,
Vector2Int point,
Vector2Int exit,
Road roadEntry,
Road roadExit )
inline

◆ RegisterSwitch() [2/2]

void CityBuilderCore.RoadManagerBaseMulti.RegisterSwitch ( Vector2Int point,
Road roadEntry,
Road roadExit )
inline

◆ SaveData()

string CityBuilderCore.RoadManagerBaseMulti.SaveData ( )
inline

serializes the objects state(usually to json) and returns it

Returns
serialized save data

Implements CityBuilderCore.ISaveData.

◆ Unblock()

void CityBuilderCore.RoadManagerBaseMulti.Unblock ( IEnumerable< Vector2Int > points,
Road road = null )
inline

◆ UnblockTags()

void CityBuilderCore.RoadManagerBaseMulti.UnblockTags ( IEnumerable< Vector2Int > points,
IEnumerable< object > tags,
Road road = null )
inline