Loading...
Searching...
No Matches
CityBuilderCore.Risk Class Referenceabstract

Detailed Description

base class for risks
risks are special building values that execute when their value fills up completely
for example fire risk that adds up and causes a fire over time unless preventative measures are provided

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

Inheritance diagram for CityBuilderCore.Risk:
CityBuilderCore.KeyedObject CityBuilderCore.IBuildingValue CityBuilderCore.IWalkerValue CityBuilderCore.IKeyed CityBuilderCore.RiskBuildingAddon CityBuilderCore.RiskBuildingReplacement CityBuilderCore.RiskBuildingTermination CityBuilderCore.RiskStructureReplacement

Public Member Functions

virtual void Execute (IRiskRecipient risker)
 
virtual void Resolve (IRiskRecipient risker)
 
bool HasValue (IBuilding building)
 whether the value even applies to the building in question
 
float GetMaximum (IBuilding building)
 the maximum value this value may get to
important for bars that use a ratio
 
float GetValue (IBuilding building)
 checks for the value the building currently has
 
Vector3 GetPosition (IBuilding building)
 the world position that the value should be visualized at
especially relevant for global values that are not created as a child of the building
 
bool HasValue (Walker walker)
 whether the value even applies to the walker in question
 
float GetMaximum (Walker _)
 the maximum value this value may get to
for example storage capacity for item quantities
important for bars that use a ratio
 
float GetValue (Walker walker)
 checks for the value the walker currently has
 
Vector3 GetPosition (Walker walker)
 the world position that the value should be visualized at
especially relevant for global values that are not created as a child of the walker
 
float GetMultiplier (IBuilding building)
 
void ModifyValue (IBuilding building, float amount)
 

Public Attributes

string Name
 
Sprite Icon
 
string ExecuteNotification
 
string ResolveNotification
 
Layer MultiplierLayer
 
float MultiplierLayerBottom
 
float MultiplierLayerTop
 
- Public Attributes inherited from CityBuilderCore.KeyedObject
string Key
 

Additional Inherited Members

- Static Public Member Functions inherited from CityBuilderCore.KeyedObject
static T GetKeyedObject< T > (string key)
 
- Properties inherited from CityBuilderCore.IKeyed

Member Function Documentation

◆ GetMaximum() [1/2]

float CityBuilderCore.Risk.GetMaximum ( IBuilding building)

the maximum value this value may get to
important for bars that use a ratio

Parameters
buildingthe building in question
Returns
max value the building might ever return

Implements CityBuilderCore.IBuildingValue.

◆ GetMaximum() [2/2]

float CityBuilderCore.Risk.GetMaximum ( Walker walker)

the maximum value this value may get to
for example storage capacity for item quantities
important for bars that use a ratio

Parameters
walkerthe walker in question
Returns
max value the walker might ever return

Implements CityBuilderCore.IWalkerValue.

◆ GetPosition() [1/2]

Vector3 CityBuilderCore.Risk.GetPosition ( IBuilding building)

the world position that the value should be visualized at
especially relevant for global values that are not created as a child of the building

Parameters
buildingthe building in question
Returns
where the value should be visualized

Implements CityBuilderCore.IBuildingValue.

◆ GetPosition() [2/2]

Vector3 CityBuilderCore.Risk.GetPosition ( Walker walker)

the world position that the value should be visualized at
especially relevant for global values that are not created as a child of the walker

Parameters
walkerthe walker in question
Returns
where the value should be visualized

Implements CityBuilderCore.IWalkerValue.

◆ GetValue() [1/2]

float CityBuilderCore.Risk.GetValue ( IBuilding building)

checks for the value the building currently has

Parameters
buildingthe building of which we want to know the value
Returns
the value of the building

Implements CityBuilderCore.IBuildingValue.

◆ GetValue() [2/2]

float CityBuilderCore.Risk.GetValue ( Walker walker)

checks for the value the walker currently has

Parameters
walkerthe walker of which we want to know the value
Returns
the value of the walker

Implements CityBuilderCore.IWalkerValue.

◆ HasValue() [1/2]

bool CityBuilderCore.Risk.HasValue ( IBuilding building)

whether the value even applies to the building in question

Parameters
buildingthe building in question
Returns
true when the building has this value

Implements CityBuilderCore.IBuildingValue.

◆ HasValue() [2/2]

bool CityBuilderCore.Risk.HasValue ( Walker walker)

whether the value even applies to the walker in question

Parameters
walkerthe walker in question
Returns
true when the walker has this value

Implements CityBuilderCore.IWalkerValue.