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

Detailed Description

straightforward conn manager implementation, should suffice for most cases

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

Inheritance diagram for CityBuilderCore.DefaultConnectionManager:
CityBuilderCore.IConnectionManager

Public Member Functions

void Calculate ()
 can be used to force calculation if the value of a connection is needed directly after changing it
 
void Register (IConnectionPasser passer)
 registers a passer with the manager, the passers points can now be used by its connection and it will be notified if any of its values changed
 
void Deregister (IConnectionPasser passer)
 removes a passer with its points from connection handling
 
bool HasPoint (Connection connection, Vector2Int point)
 checks if a connection has a point regardless of its value
 
int GetValue (Connection connection, Vector2Int point)
 gets the value of the connection at the specified point
 
Dictionary< Vector2Int, int > GetValues (Connection connection)
 returns all positions and values of a layer where the value differs from 0
 
ConnectionGrid GetGrid (Connection connection)
 

Events

Action< ConnectionChanged
 
- Events inherited from CityBuilderCore.IConnectionManager
Action< ConnectionChanged
 fired whenever the points of a connection have changed
 

Member Function Documentation

◆ Calculate()

void CityBuilderCore.DefaultConnectionManager.Calculate ( )
inline

can be used to force calculation if the value of a connection is needed directly after changing it

Implements CityBuilderCore.IConnectionManager.

◆ Deregister()

void CityBuilderCore.DefaultConnectionManager.Deregister ( IConnectionPasser passer)
inline

removes a passer with its points from connection handling

Parameters
passerthe passer that should no longer contribute to connections

Implements CityBuilderCore.IConnectionManager.

◆ GetGrid()

ConnectionGrid CityBuilderCore.DefaultConnectionManager.GetGrid ( Connection connection)
Parameters
connection
Returns

Implements CityBuilderCore.IConnectionManager.

◆ GetValue()

int CityBuilderCore.DefaultConnectionManager.GetValue ( Connection connection,
Vector2Int point )

gets the value of the connection at the specified point

Parameters
connectionthe connection to check
pointthe point at which we want to know the value
Returns
the value at the point

Implements CityBuilderCore.IConnectionManager.

◆ GetValues()

Dictionary< Vector2Int, int > CityBuilderCore.DefaultConnectionManager.GetValues ( Connection connection)

returns all positions and values of a layer where the value differs from 0

Parameters
layer
Returns

Implements CityBuilderCore.IConnectionManager.

◆ HasPoint()

bool CityBuilderCore.DefaultConnectionManager.HasPoint ( Connection connection,
Vector2Int point )

checks if a connection has a point regardless of its value

Parameters
connectionthe connection to check
pointthe point at which to check
Returns
true if there is a fitting passer at the point

Implements CityBuilderCore.IConnectionManager.

◆ Register()

void CityBuilderCore.DefaultConnectionManager.Register ( IConnectionPasser passer)
inline

registers a passer with the manager, the passers points can now be used by its connection and it will be notified if any of its values changed

Parameters
passerthe passer that should contribute to connections

Implements CityBuilderCore.IConnectionManager.