public varChange this[bool Set] { set { changed = Set ? value : changed + value; } }
public varChange this[statPart stat, bool setAll] { get { switch (stat) { case statPart.CURRENT: return currentChange; case statPart.MAX: return maxChange; case statPart.REGEN: return regenChange; default: return null; } } set { switch (stat) { case statPart.CURRENT: if (setAll) { currentChange = value; } else { currentChange += value; } break; case statPart.MAX: maxChange = setAll ? value : maxChange + value; break; case statPart.REGEN: regenChange = setAll ? value : regenChange + value; break; } } }
public Attribute(Destructible.ATTRIBUTE aName, float value = 0) { _value = value; _name = aName; changed = null; }
//Constructors public Stat(Destructible.STAT __name, float __maxValue = 0, float __regenPerSecond = 0) { _name = __name; currentValue = maxValue = __maxValue; regenPerSecond = __regenPerSecond; currentChange = null; maxChange = null; regenChange = null; }