AcceptableValueBase.cs 609 B

1234567891011121314151617181920212223
  1. namespace BepInEx.Configuration
  2. {
  3. /// <summary>
  4. /// Base type of all classes represeting and enforcing acceptable values of config settings.
  5. /// </summary>
  6. public abstract class AcceptableValueBase
  7. {
  8. /// <summary>
  9. /// Change the value to be acceptable, if it's not already.
  10. /// </summary>
  11. public abstract object Clamp(object value);
  12. /// <summary>
  13. /// Check if the value is an acceptable value.
  14. /// </summary>
  15. public abstract bool IsValid(object value);
  16. /// <summary>
  17. /// Get the string for use in config files.
  18. /// </summary>
  19. public abstract string ToSerializedString();
  20. }
  21. }