Various cleanup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Chickensoft.Collections;
|
||||
using System;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
@@ -7,7 +8,7 @@ public class LuckComponent : ILuckComponent
|
||||
{
|
||||
public IAutoProp<int> Luck => _luck;
|
||||
|
||||
private AutoProp<int> _luck;
|
||||
private readonly AutoProp<int> _luck;
|
||||
private readonly int _initialValue;
|
||||
|
||||
public LuckComponent(int initialLuck)
|
||||
@@ -22,4 +23,6 @@ public class LuckComponent : ILuckComponent
|
||||
}
|
||||
|
||||
public void IncreaseLuck(int value) => _luck.OnNext(_luck.Value + value);
|
||||
|
||||
public void DecreaseLuck(int value) => _luck.OnNext(Godot.Mathf.Max(_luck.Value - value, 0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user