Implement Meditate

This commit is contained in:
henriquenakashima 2020-09-22 01:09:20 -04:00
parent 03ca23d484
commit ceb46f98b2
14 changed files with 207 additions and 28 deletions

View file

@ -0,0 +1,23 @@
public class InsightLevel {
public delegate void InsightLevelChangedAction();
public event InsightLevelChangedAction OnChanged;
private int level;
public InsightLevel(int initialLevel) {
this.level = initialLevel;
}
public void Modify(int amount) {
int previousLevel = this.level;
this.level += amount;
if (this.level < 0) this.level = 0;
if (this.level != previousLevel && this.OnChanged != null) {
this.OnChanged();
}
}
public int Level {get => this.level;}
}