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

Detailed Description

handles layer values, may have some built in way to establish base values
ILayerAffector that only affect some points and ILayerModifier that affect a layer globally are registered with it
combining base values, affectors and modifiers it can provide the layer value for every point on the map
the value can be manually requested or automatically delivered when structures or building parts are marked as ILayerDependency

Inheritance diagram for CityBuilderCore.ILayerManager:
CityBuilderCore.DefaultLayerManager

Public Member Functions

void Register (ILayerAffector affector)
 
void Deregister (ILayerAffector affector)
 
void Register (ILayerModifier modifier)
 
void Deregister (ILayerModifier modifier)
 
bool CheckRequirement (Vector2Int origin, Vector2Int size, LayerRequirement requirement)
 checks if the points in the specified box, overall, satisfy the requirements
 
IEnumerable< ILayerDependencyGetDependencies ()
 returns all layer dependencies
dependencies might be evolutions, roads, ...
 
IEnumerable< ILayerDependencyGetDependencies (Vector2Int position)
 returns a layer dependency if one exists at that point
dependencies might be evolutions, roads, ...
 
LayerKey GetKey (Layer layer, Vector2Int position)
 returns an explanation of the layer value at a certain point(basevalue+affectors)
 
int GetValue (Vector2Int position, Layer layer)
 returns the computed total value of a layer at a point
 
IEnumerable< Tuple< Vector2Int, int > > GetValues (Layer layer)
 returns all positions and values of a layer where the value differs from 0
 

Events

Action< LayerChanged
 fired whenever an affector is added or removed
 

Member Function Documentation

◆ CheckRequirement()

bool CityBuilderCore.ILayerManager.CheckRequirement ( Vector2Int origin,
Vector2Int size,
LayerRequirement requirement )

checks if the points in the specified box, overall, satisfy the requirements

Parameters
origin
size
requirement
Returns

Implemented in CityBuilderCore.DefaultLayerManager.

◆ GetDependencies() [1/2]

IEnumerable< ILayerDependency > CityBuilderCore.ILayerManager.GetDependencies ( )

returns all layer dependencies
dependencies might be evolutions, roads, ...

Parameters
position
Returns

Implemented in CityBuilderCore.DefaultLayerManager.

◆ GetDependencies() [2/2]

IEnumerable< ILayerDependency > CityBuilderCore.ILayerManager.GetDependencies ( Vector2Int position)

returns a layer dependency if one exists at that point
dependencies might be evolutions, roads, ...

Parameters
position
Returns

Implemented in CityBuilderCore.DefaultLayerManager.

◆ GetKey()

LayerKey CityBuilderCore.ILayerManager.GetKey ( Layer layer,
Vector2Int position )

returns an explanation of the layer value at a certain point(basevalue+affectors)

Parameters
layer
position
Returns

Implemented in CityBuilderCore.DefaultLayerManager.

◆ GetValue()

int CityBuilderCore.ILayerManager.GetValue ( Vector2Int position,
Layer layer )

returns the computed total value of a layer at a point

Parameters
position
layer
Returns

Implemented in CityBuilderCore.DefaultLayerManager.

◆ GetValues()

IEnumerable< Tuple< Vector2Int, int > > CityBuilderCore.ILayerManager.GetValues ( Layer layer)

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

Parameters
layer
Returns

Implemented in CityBuilderCore.DefaultLayerManager.