simple eating )

This commit is contained in:
2023-02-28 23:41:38 +02:00
parent 75b9665674
commit 811b2efc85
9 changed files with 55 additions and 252 deletions
+11 -8
View File
@@ -1,29 +1,32 @@
public class Stat
{
public string Name { get; set; }
public decimal Value { get; set; }
public decimal Price { get; set; }
public decimal Quantity { get; set; }
public float Value { get; set; }
public float Price { get; set; }
public float Quantity { get; set; }
public float MaxValue { get; set; }
public Stat(string name, decimal startValue)
public Stat(string name, float startValue, float maxValue)
{
Name = name;
Value = startValue;
MaxValue = maxValue;
}
public Stat(string name, decimal price, decimal quantity)
public Stat(string name, float price, float quantity, float maxValue)
{
Name = name;
Price = price;
Quantity = quantity;
MaxValue = maxValue;
}
public void increase(decimal byAmount)
public void increase(float byAmount)
{
Value += byAmount;
}
public bool deduct(decimal amount)
public bool deduct(float amount)
{
if (Value >= amount)
{
@@ -33,7 +36,7 @@ public class Stat
return false;
}
public void forceDeduct(decimal amount)
public void forceDeduct(float amount)
{
Value -= amount;
}