Configuration.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // -----------------------------------------------------------------------
  2. // <copyright file="Configuration.cs" company="">
  3. // Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
  4. // </copyright>
  5. // -----------------------------------------------------------------------
  6. namespace UnityEngine.U2D.Animation.TriangleNet
  7. {
  8. using System;
  9. using Animation.TriangleNet.Meshing;
  10. using Animation.TriangleNet.Meshing.Algorithm;
  11. /// <summary>
  12. /// Configure advanced aspects of the library.
  13. /// </summary>
  14. internal class Configuration
  15. {
  16. public Configuration()
  17. : this(() => RobustPredicates.Default, () => new TrianglePool())
  18. {
  19. }
  20. public Configuration(Func<IPredicates> predicates)
  21. : this(predicates, () => new TrianglePool())
  22. {
  23. }
  24. public Configuration(Func<IPredicates> predicates, Func<TrianglePool> trianglePool)
  25. {
  26. Predicates = predicates;
  27. TrianglePool = trianglePool;
  28. }
  29. /// <summary>
  30. /// Gets or sets the factory method for the <see cref="IPredicates"/> implementation.
  31. /// </summary>
  32. public Func<IPredicates> Predicates { get; set; }
  33. /// <summary>
  34. /// Gets or sets the factory method for the <see cref="TrianglePool"/>.
  35. /// </summary>
  36. public Func<TrianglePool> TrianglePool { get; set; }
  37. }
  38. }