27 lines
1.1 KiB
C#
27 lines
1.1 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Questionable.Controller.Conditions;
|
|
|
|
internal sealed class TimePlayedCondition : StopCondition
|
|
{
|
|
public required int Minutes { get; set; }
|
|
|
|
public override bool IsSession => true;
|
|
|
|
public override EStopConditionType Type => EStopConditionType.TimePlayed;
|
|
|
|
public override bool Evaluate(StopEvaluationContext context)
|
|
{
|
|
return context.ElapsedSinceStart >= TimeSpan.FromMinutes(Minutes);
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public override string GetDescription()
|
|
{
|
|
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1);
|
|
defaultInterpolatedStringHandler.AppendFormatted(Minutes);
|
|
defaultInterpolatedStringHandler.AppendLiteral(global::_003CModule_003E._206C_202A_206D_206A_206E_202A_202B_206F_206D_200F_202D_200F_202D_206A_202C_202B_206D_206A_200E_200E_202D_202D_200D_200C_200D_200D_206D_206E_202A_200F_206E_206C_206D_206A_206D_202B_200F_200D_206E_200C_202E<string>(-470345411));
|
|
return defaultInterpolatedStringHandler.ToStringAndClear();
|
|
}
|
|
}
|