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

Detailed Description

handles connections and their values

Inheritance diagram for CityBuilderCore.IConnectionManager:
CityBuilderCore.DefaultConnectionManager

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
 fired whenever the points of a connection have changed
 

Member Function Documentation

◆ Calculate()

void CityBuilderCore.IConnectionManager.Calculate ( )

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

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ Deregister()

void CityBuilderCore.IConnectionManager.Deregister ( IConnectionPasser passer)

removes a passer with its points from connection handling

Parameters
passerthe passer that should no longer contribute to connections

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ GetGrid()

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

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ GetValue()

int CityBuilderCore.IConnectionManager.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

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ GetValues()

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

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

Parameters
layer
Returns

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ HasPoint()

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

Implemented in CityBuilderCore.DefaultConnectionManager.

◆ Register()

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

Parameters
passerthe passer that should contribute to connections

Implemented in CityBuilderCore.DefaultConnectionManager.