merge projects and arrange script folders
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
public class Stat
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public double Value { get; set; }
|
||||
public double Price { get; set; }
|
||||
public double Quantity { get; set; }
|
||||
|
||||
public Stat(string name, double startValue)
|
||||
{
|
||||
Name = name;
|
||||
Value = startValue;
|
||||
}
|
||||
|
||||
public Stat(string name, double price, double quantity)
|
||||
{
|
||||
Name = name;
|
||||
Price = price;
|
||||
Quantity = quantity;
|
||||
}
|
||||
|
||||
public void increase(double byAmount)
|
||||
{
|
||||
Value += byAmount;
|
||||
}
|
||||
|
||||
public bool deduct(double amount)
|
||||
{
|
||||
if (Value >= amount)
|
||||
{
|
||||
Value -= amount;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void forceDeduct(double amount)
|
||||
{
|
||||
Value -= amount;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user