fix stats

This commit is contained in:
2023-11-17 15:33:02 +02:00
parent 725081c2cd
commit 448367d6d3
3 changed files with 12 additions and 15 deletions
+9 -6
View File
@@ -1,10 +1,10 @@
public class Stat
{
public string Name { get; set; }
public float Value { get; set; }
public float Price { get; set; }
public float Quantity { get; set; }
public float MaxValue { get; set; }
public string Name { get; private set; }
public float Value { get; private set; }
public float Price { get; private set; }
public float Quantity { get; private set; }
public float MaxValue { get; private set; }
public Stat(string name, float startValue, float maxValue)
{
@@ -23,7 +23,10 @@ public class Stat
public void increase(float byAmount)
{
Value += byAmount;
if (Value < MaxValue)
{
Value += byAmount;
}
}
public bool deduct(float amount)