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

Detailed Description

addon that simulates a disease

for the duration of its existance the addon can spawn walkers that further spread the disease
kills its housings population either continuously, at the start or end of the duration
after the duration the disease is fully healed
disease also fully disrupts efficiency which eg keeps the population from working

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

Inheritance diagram for CityBuilderCore.DiseaseAddon:
CityBuilderCore.BuildingAddon CityBuilderCore.IEfficiencyFactor CityBuilderCore.KeyedBehaviour CityBuilderCore.ISaveData CityBuilderCore.IKeyed

Classes

class  DiseaseData
 

Public Member Functions

override void InitializeAddon ()
 called by the Building after the addon has been instantiated and Building has been set
 
override void TerminateAddon ()
 called by the Building when the addon gets removed
this should usually terminate the addon(mark as terminated and Destroy)
 
override void OnReplacing (Transform parent, IBuilding replacement)
 called be the addons building when the building gets replaced
this has to move the addon over to the new building
otherwise it will be destroyed with the old one
 
override void Update ()
 
override string SaveData ()
 serializes the objects state(usually to json) and returns it
 
override void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
- Public Member Functions inherited from CityBuilderCore.BuildingAddon
virtual void Awake ()
 
virtual void Start ()
 
void Remove ()
 Removes the addon from the Building it is located on
this will usually result in the termination of the addon.
 

Public Attributes

Risk Risk
 
CyclicRiskWalkerSpawner Spawner
 
float Duration = 30f
 
DiseaseMortality Mortality = DiseaseMortality.Final
 
float MortalityRate = 100f
 
- Public Attributes inherited from CityBuilderCore.BuildingAddon
AddonAccumulationMode Accumulation
 
bool Save
 
bool Center
 
bool Scale
 
- Public Attributes inherited from CityBuilderCore.KeyedBehaviour
string Key
 

Properties

bool IsWorking [get]
 false disrupts the building
 
float Factor [get]
 how efficiency is changed by this component(0-1), a buildings efficiency is calculated by multiplying all of its efficiency factors
 
- Properties inherited from CityBuilderCore.BuildingAddon
IBuilding Building [get, set]
 
- Properties inherited from CityBuilderCore.IKeyed
- Properties inherited from CityBuilderCore.IEfficiencyFactor

Additional Inherited Members

- Public Types inherited from CityBuilderCore.BuildingAddon
enum  AddonAccumulationMode { Stack , Queue , Replace , Single }
 specifies how the addon behaves when there is more than one at the same time More...
 
- Protected Attributes inherited from CityBuilderCore.BuildingAddon
bool _isTerminated
 

Member Function Documentation

◆ InitializeAddon()

override void CityBuilderCore.DiseaseAddon.InitializeAddon ( )
inlinevirtual

called by the Building after the addon has been instantiated and Building has been set

Reimplemented from CityBuilderCore.BuildingAddon.

◆ LoadData()

override void CityBuilderCore.DiseaseAddon.LoadData ( string json)
inlinevirtual

deserializes the serialized json data and loads the data as its new state

Parameters
json

Reimplemented from CityBuilderCore.BuildingAddon.

◆ OnReplacing()

override void CityBuilderCore.DiseaseAddon.OnReplacing ( Transform parent,
IBuilding replacement )
inlinevirtual

called be the addons building when the building gets replaced
this has to move the addon over to the new building
otherwise it will be destroyed with the old one

Parameters
parent
replacement

Reimplemented from CityBuilderCore.BuildingAddon.

◆ SaveData()

override string CityBuilderCore.DiseaseAddon.SaveData ( )
inlinevirtual

serializes the objects state(usually to json) and returns it

Returns
serialized save data

Reimplemented from CityBuilderCore.BuildingAddon.

◆ TerminateAddon()

override void CityBuilderCore.DiseaseAddon.TerminateAddon ( )
inlinevirtual

called by the Building when the addon gets removed
this should usually terminate the addon(mark as terminated and Destroy)

Reimplemented from CityBuilderCore.BuildingAddon.

◆ Update()

override void CityBuilderCore.DiseaseAddon.Update ( )
inlinevirtual

Reimplemented from CityBuilderCore.BuildingAddon.

Property Documentation

◆ Factor

float CityBuilderCore.DiseaseAddon.Factor
get

how efficiency is changed by this component(0-1), a buildings efficiency is calculated by multiplying all of its efficiency factors

Implements CityBuilderCore.IEfficiencyFactor.

◆ IsWorking

bool CityBuilderCore.DiseaseAddon.IsWorking
get

false disrupts the building

Implements CityBuilderCore.IEfficiencyFactor.