2022-11-14 14:19:14 +03:00
|
|
|
namespace Syntriax.Modules.Trigger
|
|
|
|
{
|
|
|
|
public static class ITriggerExtensions
|
|
|
|
{
|
|
|
|
/// <summary>
|
2022-12-17 14:39:54 +03:00
|
|
|
/// Checks if the provided parameter <see cref="ITrigger"/> is toggled, if the parameter is null returns the nullValue parameter
|
2022-11-14 14:19:14 +03:00
|
|
|
/// </summary>
|
2022-12-17 14:39:54 +03:00
|
|
|
/// <param name="trigger"><see cref="ITrigger"/> to be checked if toggled or not</param>
|
|
|
|
/// <param name="nullValue">The value that will be returned if trigger is null. Default value: true</param>
|
|
|
|
/// <returns><see cref="ITrigger"/>'s toggle value, or if null return nullValue parameter</returns>
|
2022-11-14 14:19:14 +03:00
|
|
|
public static bool IsTriggeredNullChecked(this ITrigger trigger, bool nullValue = true)
|
|
|
|
=> trigger == null ? nullValue : trigger.IsTrigerred;
|
|
|
|
}
|
|
|
|
}
|