예제 #1
0
 public static ValueBuilder Minimum(this IValueBuilders valueFactory, ValueBuilder left, ValueBuilder right)
 => valueFactory.If(left > right).Then(right).Else(left);
예제 #2
0
 public static ValueBuilder Maximum(this IValueBuilders valueFactory, ValueBuilder left, double right)
 => valueFactory.If(left < right).Then(right).Else(left);
예제 #3
0
 public static ValueBuilder Floor(this ValueBuilder value)
 => value.Select(Math.Floor, o => "Floor(" + o + ")");
예제 #4
0
 public static ValueBuilder Ceiling(this ValueBuilder value)
 => value.Select(Math.Ceiling, o => "Ceiling(" + o + ")");
예제 #5
0
 /// <summary>
 /// Returns a value converter multiplying values by <c>(stat.Value / divideBy).Ceiling</c>.
 /// </summary>
 public static Func <ValueBuilder, ValueBuilder> PerStatCeiled(IStatBuilder stat, ValueBuilder divideBy) =>
 v => v * (stat.Value / divideBy).Ceiling();
예제 #6
0
 /// <summary>
 /// Returns <c>value.AsPercentage * stat.Value</c>.
 /// </summary>
 public static ValueBuilder PercentOf(this ValueBuilder value, IStatBuilder stat) =>
 value.AsPercentage * stat.Value;
예제 #7
0
 public static Func <ValueBuilder, ValueBuilder> PerStat(ValueBuilder statValue, ValueBuilder divideBy) =>
 v => v * (statValue / divideBy).Floor();
예제 #8
0
 /// <summary>
 /// Returns a value converter multiplying values by <c>(stat.Value / divideBy).Floor</c>.
 /// </summary>
 public static Func <ValueBuilder, ValueBuilder> PerStat(IStatBuilder stat, ValueBuilder divideBy) =>
 PerStat(stat.Value, divideBy);
예제 #9
0
 /// <summary>
 /// Returns a value converter multiplying values by <c>(stat.Value / divideBy).Floor</c>.
 /// </summary>
 public static Func <ValueBuilder, ValueBuilder> PerStat(IStatBuilder stat, ValueBuilder divideBy) =>
 v => v * (stat.Value / divideBy).Floor;
예제 #10
0
 /// <summary>
 /// Returns a value converter multiplying values by <c>(stat.Value / divideBy).Ceiling</c>.
 /// </summary>
 public static Func <ValueBuilder, ValueBuilder> PerStatCeiled(IStatBuilder stat, ValueBuilder divideBy) =>
 v => v * (stat.Value / divideBy).Select(Math.Ceiling, o => $"Ceiling({o})");
예제 #11
0
 public static Func <ValueBuilder, ValueBuilder> PerStat(ValueBuilder statValue, ValueBuilder divideBy) =>
 v => v * (statValue / divideBy).Select(Math.Floor, o => $"Floor({o})");