示例#1
0
 /// <summary>
 /// Initializes and returns a new instance of the <see cref="T:Bannerlord.ButterLib.DistanceMatrix.DistanceMatrix`1"/> class
 /// as per actual implementation with custom methods that will be used to get the list of analyzed objects
 /// and calculate the distances between them.
 /// </summary>
 /// <param name="customListGetter">
 /// A delegate to the method that will be used to get a list of objects of type <typeparamref name="T"/>
 /// for calculating the distances between them.
 /// </param>
 /// <param name="customDistanceCalculator">
 /// A delegate to the method that will be used to calculate the distance between two given type <typeparamref name="T"/> objects.
 /// </param>
 /// <exception cref="T:System.ArgumentException"></exception>
 public static DistanceMatrix <T>?Create(Func <IEnumerable <T> > customListGetter, Func <T, T, float> customDistanceCalculator) =>
 StaticInstance?.Create(customListGetter, customDistanceCalculator);
示例#2
0
 /// <summary>
 /// Initializes and returns a new instance of the <see cref="T:Bannerlord.ButterLib.DistanceMatrix.DistanceMatrix`1"/> class
 /// as per actual implementation with the default EntityListGetter and DistanceCalculator methods.
 /// </summary>
 /// <exception cref="T:System.ArgumentException"></exception>
 public static DistanceMatrix <T>?Create() => StaticInstance?.Create <T>();