Files
SimUL/Assets/Scripts/Stat.cs
T
Vladimir Koshevarov 73f06d8754 added tooltips
2022-11-29 19:09:00 +02:00

42 lines
822 B
C#

public class Stat
{
public string Name { get; set; }
public decimal Value { get; set; }
public decimal Price { get; set; }
public decimal Quantity { get; set; }
public Stat(string name, decimal startValue)
{
Name = name;
Value = startValue;
}
public Stat(string name, decimal price, decimal quantity)
{
Name = name;
Price = price;
Quantity = quantity;
}
public void increase(decimal byAmount)
{
Value += byAmount;
}
public bool deduct(decimal amount)
{
if (Value >= amount)
{
Value -= amount;
return true;
}
return false;
}
public void forceDeduct(decimal amount)
{
Value -= amount;
}
}