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

Detailed Description

layer manager iomplementation that can use a tilemap to define the base values

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

Inheritance diagram for CityBuilderCore.DefaultLayerManager:
CityBuilderCore.ILayerManager

Public Member Functions

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

Public Attributes

Tilemap AffectingTilemap
 
LayerAffectorTile[] AffectingTiles
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 

Events

Action< LayerChanged
 
- Events inherited from CityBuilderCore.ILayerManager
Action< LayerChanged
 fired whenever an affector is added or removed
 

Member Function Documentation

◆ CheckRequirement()

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

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

Parameters
origin
size
requirement
Returns

Implements CityBuilderCore.ILayerManager.

◆ Deregister() [1/2]

void CityBuilderCore.DefaultLayerManager.Deregister ( ILayerAffector affector)
inline

◆ Deregister() [2/2]

void CityBuilderCore.DefaultLayerManager.Deregister ( ILayerModifier modifier)
inline

◆ GetDependencies() [1/2]

virtual IEnumerable< ILayerDependency > CityBuilderCore.DefaultLayerManager.GetDependencies ( )
inlinevirtual

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

Parameters
position
Returns

Implements CityBuilderCore.ILayerManager.

◆ GetDependencies() [2/2]

virtual IEnumerable< ILayerDependency > CityBuilderCore.DefaultLayerManager.GetDependencies ( Vector2Int position)
inlinevirtual

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

Parameters
position
Returns

Implements CityBuilderCore.ILayerManager.

◆ GetKey()

LayerKey CityBuilderCore.DefaultLayerManager.GetKey ( Layer layer,
Vector2Int position )
inline

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

Parameters
layer
position
Returns

Implements CityBuilderCore.ILayerManager.

◆ GetValue()

int CityBuilderCore.DefaultLayerManager.GetValue ( Vector2Int position,
Layer layer )
inline

returns the computed total value of a layer at a point

Parameters
position
layer
Returns

Implements CityBuilderCore.ILayerManager.

◆ GetValues()

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

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

Parameters
layer
Returns

Implements CityBuilderCore.ILayerManager.

◆ Register() [1/2]

void CityBuilderCore.DefaultLayerManager.Register ( ILayerAffector affector)
inline

◆ Register() [2/2]

void CityBuilderCore.DefaultLayerManager.Register ( ILayerModifier modifier)
inline