rlauuzo 60c735282e
apply auto-fixes from VS Code (#283)
Co-authored-by: rlauu <46294892+rlauu@users.noreply.github.com>
2024-09-10 18:08:42 +02:00

46 lines
1.0 KiB
C#

namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Warning manager.
/// </summary>
public static class WarningManager
{
private static PluginWarning _warnings;
/// <summary>
/// Set warning.
/// </summary>
/// <param name="warning">Warning.</param>
public static void SetFlag(PluginWarning warning)
{
_warnings |= warning;
}
/// <summary>
/// Clear warnings.
/// </summary>
public static void Clear()
{
_warnings = PluginWarning.None;
}
/// <summary>
/// Get warnings.
/// </summary>
/// <returns>Warnings.</returns>
public static string GetWarnings()
{
return _warnings.ToString();
}
/// <summary>
/// Check if a specific warning flag is set.
/// </summary>
/// <param name="warning">Warning flag to check.</param>
/// <returns>True if the flag is set, otherwise false.</returns>
public static bool HasFlag(PluginWarning warning)
{
return (_warnings & warning) == warning;
}
}