Repeatable quest generation MongoID conversion (#439)

* Update repeatable quest generation for mongoid, add new server localizations, switch `Traders` to MongoId

* Give error default value
This commit is contained in:
Cj
2025-07-02 07:44:49 -04:00
committed by GitHub
parent abab349a0c
commit 371c9d58f0
15 changed files with 222 additions and 163 deletions
@@ -55,5 +55,29 @@
{
return values.Select(v => v * factor);
}
/// <summary>
/// Helper to determine if one double is approx equal to another double
/// </summary>
/// <param name="value">Value to check</param>
/// <param name="target">Target value</param>
/// <param name="error">Error value</param>
/// <returns>True if value is approx target within the error range</returns>
public static bool Approx(this double value, double target, double error = 0.001d)
{
return Math.Abs(value - target) <= error;
}
/// <summary>
/// Helper to determine if one float is approx equal to another float
/// </summary>
/// <param name="value">Value to check</param>
/// <param name="target">Target value</param>
/// <param name="error">Error value</param>
/// <returns>True if value is approx target within the error range</returns>
public static bool Approx(this float value, float target, float error = 0.001f)
{
return Math.Abs(value - target) <= error;
}
}
}