public StatWithMax Reduce(int amount) { StatWithMax result = this; Current = Math.Max(0, Current - amount); return(result); }
public object Clone() { StatWithMax copy = new StatWithMax(); copy.max = this.max; copy.current = this.current; return(copy); }
public StatWithMax Add(int amount) { StatWithMax result = this; if (amount == int.MaxValue) { Current = Max; } else { Current = Math.Min(Max, Current + amount); } return(result); }