PkmnLib.NET/PkmnLib.Dynamic/StaticHelpers.cs

18 lines
608 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 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>
public static Func<DateTime> DateTimeProvider { get; set; } = () => DateTime.Now;
/// <summary>
/// Get the current date and time.
/// </summary>
public static DateTime GetCurrentDateTime() => DateTimeProvider();
}