forked from GarwelGarwel/KerbalHealth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HealthFactor.cs
43 lines (37 loc) · 1.47 KB
/
HealthFactor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
namespace KerbalHealth
{
public abstract class HealthFactor
{
/// <summary>
/// Internal name of the factor
/// </summary>
abstract public string Name { get; }
/// <summary>
/// Display name of the factor
/// </summary>
virtual public string Title => Name;
/// <summary>
/// This factor can/should be cached for unloaded kerbals
/// </summary>
virtual public bool Cachable => true;
/// <summary>
/// Is the factor considered when calculating estimated HP change in Health Report
/// </summary>
//public bool EnabledInEditor { get; set; }
bool enabledInEditor = true;
public bool IsEnabledInEditor() => enabledInEditor;
public void SetEnabledInEditor(bool state) => enabledInEditor = state;
virtual public void ResetEnabledInEditor() => SetEnabledInEditor(true);
/// <summary>
/// Returns factor's HP change per day as set in the Settings (use KerbalHealthFactorsSettings.[factorName])
/// </summary>
abstract public double BaseChangePerDay { get; }
/// <summary>
/// Returns actual factor's HP change per day for a given kerbal, before factor multipliers
/// </summary>
/// <param name="pcm"></param>
/// <returns></returns>
abstract public double ChangePerDay(ProtoCrewMember pcm);
public HealthFactor() => ResetEnabledInEditor();
}
}