public Attribute(AttrPresetTpl preset, bool isCalculationInversed) { isModDirty = true; modifiers = new float[EnumArray.AttrModifierLayer.Length]; independents = new List <float>(indSize); this.preset = preset; Calculate = isCalculationInversed ? (System.Action)InverseCalculate : NormalCalculate; }
public static IAttribute Create(AttrPresetTpl attrPreset, EAttrType type) { bool _isInversed = false; // decide type of calculator switch (type) { case EAttrType.Dodge: case EAttrType.Armor: _isInversed = true; break; } return(new Attribute(attrPreset, _isInversed)); }