int CompareModifiers(TPModifier modifier1, TPModifier modifier2) { if (modifier1.Priority > modifier2.Priority) { return(1); } else if (modifier1.Priority < modifier2.Priority) { return(-1); } return(0); }
/// <summary> /// Removes TPModifier from list of modifiers, sorts modifiers, recalculates Value /// </summary> /// <param name="modifier"></param> public void RemoveModifier(TPModifier modifier) { _modifiers.Remove(modifier); Recalculate(); }
/// <summary> /// Adds TPModifier to list of modifiers, sorts modifiers, recalculates Value /// </summary> /// <param name="modifier"></param> public void AddModifier(TPModifier modifier) { _modifiers.Add(modifier); _modifiers.Sort(CompareModifiers); Recalculate(); }