Rework game over logic and game initialization
This commit is contained in:
@@ -8,10 +8,17 @@ public class LuckComponent : ILuckComponent
|
||||
public IAutoProp<int> Luck => _luck;
|
||||
|
||||
private AutoProp<int> _luck;
|
||||
private readonly int _initialValue;
|
||||
|
||||
public LuckComponent(int initialLuck)
|
||||
{
|
||||
_luck = new AutoProp<int>(initialLuck);
|
||||
_initialValue = initialLuck;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_luck.OnNext(_initialValue);
|
||||
}
|
||||
|
||||
public void IncreaseLuck(int value) => _luck.OnNext(_luck.Value + value);
|
||||
|
||||
Reference in New Issue
Block a user