Rework game over logic and game initialization
This commit is contained in:
@@ -14,10 +14,19 @@ public class DefenseComponent : IDefenseComponent
|
||||
|
||||
private readonly AutoProp<int> _maximumDefense;
|
||||
|
||||
private readonly int _initialValue;
|
||||
|
||||
public DefenseComponent(int defenseValue)
|
||||
{
|
||||
_maximumDefense = new AutoProp<int>(defenseValue);
|
||||
_currentDefense = new AutoProp<int>(defenseValue);
|
||||
_initialValue = defenseValue;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_maximumDefense.OnNext(_initialValue);
|
||||
_currentDefense.OnNext(_initialValue);
|
||||
}
|
||||
|
||||
public void Restore(int restoreAmount)
|
||||
|
||||
Reference in New Issue
Block a user