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

Detailed Description

building component handling evolution(checking the current stage and replacing the building in case it has changed)

Inheritance diagram for CityBuilderCore.IEvolution:
CityBuilderCore.IBuildingComponent CityBuilderCore.IItemRecipient CityBuilderCore.IServiceRecipient CityBuilderCore.ILayerDependency CityBuilderCore.ISaveData CityBuilderCore.IBuildingComponent CityBuilderCore.IItemOwner CityBuilderCore.IBuildingComponent CityBuilderCore.ISaveData CityBuilderCore.ISaveData CityBuilderCore.EvolutionComponent

Public Member Functions

void CheckEvolution ()
 manually check if the evolution has changed in case any circumstances outside the components control have changed
 
- Public Member Functions inherited from CityBuilderCore.IBuildingComponent
void SetupComponent ()
 only called when the building is originally placed, before Initialize
 
void InitializeComponent ()
 initialization is performed when the building is placed or loaded
use to create references, register traits, ...
 
void TerminateComponent ()
 termination is performed when the building is destroyed
use to deregister traits, remove references from other systems
 
void OnReplacing (IBuilding replacement)
 called when a component gets replaced
use to transfer resources, replace references
 
void OnMoving ()
 called when the building is about to be moved
can be used to remove/deregister stuff from the old position
 
void OnMoved (Vector2Int oldPoint, BuildingRotation oldRotation)
 called after a building has been moved
can be used to register things at the new position
 
void SuspendComponent ()
 temporarily stops the component from working
 
void ResumeComponent ()
 resumes work in the component after SuspendComponent has been called
 
string GetDebugText ()
 text displayed in scene editor
 
string GetDescription ()
 text that may be displayed in dialogs
 
- Public Member Functions inherited from CityBuilderCore.ISaveData
string SaveData ()
 serializes the objects state(usually to json) and returns it
 
void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
- Public Member Functions inherited from CityBuilderCore.IItemRecipient
IEnumerable< ItemGetRecipientItems ()
 use this to check which items the recipient needs
 
IEnumerable< ItemQuantityGetRecipientItemQuantities ()
 checks how much of every needed item the recipient currently has
 
void FillRecipient (ItemStorage itemStorage)
 passes a storage to the recipient which will take any item from it that it needs
 
- Public Member Functions inherited from CityBuilderCore.IServiceRecipient
bool HasServiceValue (Service service)
 whether the recipient handles a particular serviec
for example a bar visualization should not be created on a building that does not even have the service that is visualized
 
float GetServiceValue (Service service)
 check how much service value is left in the recipient
 
void ModifyService (Service service, float amount)
 changes a services value in the recipient
services have to be increased regularly or access will be lost
 
- Public Member Functions inherited from CityBuilderCore.ILayerDependency
void CheckLayers (IEnumerable< Vector2Int > points)
 gets called when
 

Additional Inherited Members

- Properties inherited from CityBuilderCore.IBuildingComponent
string Key [get]
 unique key used to identify the component in save/load
 
IBuilding Building [get, set]
 the building the component is attached to
is set by the building in awake
 
- Properties inherited from CityBuilderCore.IItemOwner
IItemContainer ItemContainer [get]
 holds and manages the items for the owner
 

Member Function Documentation

◆ CheckEvolution()

void CityBuilderCore.IEvolution.CheckEvolution ( )

manually check if the evolution has changed in case any circumstances outside the components control have changed

Implemented in CityBuilderCore.EvolutionComponent.