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

Detailed Description

base class for simple road managers that create a single road network out of any Road added
this means walkers will be able to use any road, if you need seperate road networks per road use RoadManagerBaseMulti
the base class provides all the plumbing between the network and manager
the implementations have to provide the actual RoadNetwork which determines how roads are visualized

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

Inheritance diagram for CityBuilderCore.RoadManagerBase:
CityBuilderCore.IRoadManager CityBuilderCore.IRoadGridLinker CityBuilderCore.ISaveData CityBuilderCore.IGridLinker CityBuilderCore.DefaultRoadManager CityBuilderCore.TerrainRoadManager

Public Member Functions

void Add (IEnumerable< Vector2Int > positions, Road road)
 
void Register (IEnumerable< Vector2Int > points, Road road)
 
void Deregister (IEnumerable< Vector2Int > points, Road road)
 
void RegisterSwitch (Vector2Int point, Road roadA, Road roadB)
 
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)
 
bool CheckRequirement (Vector2Int point, RoadRequirement requirement)
 
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
 
Road DefaultRoad
 
StructureLevelMask Level
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void Update ()
 
virtual void OnDestroy ()
 
RoadNetwork createNetwork ()
 

Properties

Transform Root [get]
 
StructureReference StructureReference [get, set]
 

Member Function Documentation

◆ Add()

void CityBuilderCore.RoadManagerBase.Add ( IEnumerable< Vector2Int > positions,
Road road )

◆ Block()

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

◆ BlockTags()

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

◆ CheckRequirement()

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

◆ Deregister()

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

◆ DeregisterLink()

void CityBuilderCore.RoadManagerBase.DeregisterLink ( IGridLink link,
object tag )

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.

◆ GetLink()

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

◆ LoadData()

void CityBuilderCore.RoadManagerBase.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.RoadManagerBase.Register ( IEnumerable< Vector2Int > points,
Road road )

◆ RegisterLink()

void CityBuilderCore.RoadManagerBase.RegisterLink ( IGridLink link,
object tag )

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.RoadManagerBase.RegisterSwitch ( Vector2Int entry,
Vector2Int point,
Vector2Int exit,
Road roadEntry,
Road roadExit )

◆ RegisterSwitch() [2/2]

void CityBuilderCore.RoadManagerBase.RegisterSwitch ( Vector2Int point,
Road roadA,
Road roadB )

◆ SaveData()

string CityBuilderCore.RoadManagerBase.SaveData ( )
inline

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

Returns
serialized save data

Implements CityBuilderCore.ISaveData.

◆ Unblock()

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

◆ UnblockTags()

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