示例#1
0
        public StatWithMax Reduce(int amount)
        {
            StatWithMax result = this;

            Current = Math.Max(0, Current - amount);
            return(result);
        }
示例#2
0
        public object Clone()
        {
            StatWithMax copy = new StatWithMax();

            copy.max     = this.max;
            copy.current = this.current;
            return(copy);
        }
示例#3
0
        public StatWithMax Add(int amount)
        {
            StatWithMax result = this;

            if (amount == int.MaxValue)
            {
                Current = Max;
            }
            else
            {
                Current = Math.Min(Max, Current + amount);
            }
            return(result);
        }