straightforward conn manager implementation, should suffice for most cases
https://citybuilder.softleitner.com/manual/connections
|
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) |
|
|
Action< Connection > | Changed |
|
Action< Connection > | Changed |
| fired whenever the points of a connection have changed
|
|
◆ Calculate()
void CityBuilderCore.DefaultConnectionManager.Calculate |
( |
| ) |
|
|
inline |
◆ Deregister()
removes a passer with its points from connection handling
- Parameters
-
passer | the passer that should no longer contribute to connections |
Implements CityBuilderCore.IConnectionManager.
◆ GetGrid()
◆ GetValue()
int CityBuilderCore.DefaultConnectionManager.GetValue |
( |
Connection | connection, |
|
|
Vector2Int | point ) |
gets the value of the connection at the specified point
- Parameters
-
connection | the connection to check |
point | the 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 | ) |
|
◆ HasPoint()
bool CityBuilderCore.DefaultConnectionManager.HasPoint |
( |
Connection | connection, |
|
|
Vector2Int | point ) |
checks if a connection has a point regardless of its value
- Parameters
-
connection | the connection to check |
point | the point at which to check |
- Returns
- true if there is a fitting passer at the point
Implements CityBuilderCore.IConnectionManager.
◆ Register()
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
-
passer | the passer that should contribute to connections |
Implements CityBuilderCore.IConnectionManager.