PkmnLib.NET/PkmnLib.Dynamic/StaticHelpers.cs
Deukhoofd 2533512eda
All checks were successful
Build / Build (push) Successful in 51s
Slight cleanup, do some TODOs
2025-06-22 10:42:25 +02:00

24 lines
803 B
C#

namespace PkmnLib.Dynamic;
/// <summary>
/// A static helper class that contains functions that are used in multiple places.
/// </summary>
public static class StaticHelpers
{
/// <summary>
/// A delegate that provides the current date and time.
/// </summary>
public delegate DateTimeOffset DateTimeProviderDelegate();
/// <summary>
/// A function to get the current date and time. This can be replaced in cases where the date and time
/// may not be the same as the system time.
/// </summary>
[PublicAPI]
public static DateTimeProviderDelegate DateTimeProvider { get; set; } = () => DateTimeOffset.Now;
/// <summary>
/// Get the current date and time.
/// </summary>
public static DateTimeOffset GetCurrentDateTime() => DateTimeProvider();
}