mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-25 10:05:49 +08:00
23 lines
785 B
C#
23 lines
785 B
C#
using System;
|
|
using System.Collections.Immutable;
|
|
|
|
namespace BetterGenshinImpact.CombatScript;
|
|
|
|
public class WaitSymbol : InstructionSymbol, IInstructionSymbolHasDuration
|
|
{
|
|
public WaitSymbol(ImmutableArray<IParameterSymbol> parameterList, ImmutableArray<TriviaSymbol> trivia)
|
|
: base("wait", parameterList, trivia)
|
|
{
|
|
InstructionThrowHelper.ThrowIfParameterListIsDefault(parameterList);
|
|
InstructionThrowHelper.ThrowIfParameterListCountNotCorrect(parameterList, [1]);
|
|
|
|
InstructionThrowHelper.ThrowIfParameterAtIndexIsNot(parameterList, 0, out DoubleSymbol doubleSymbol);
|
|
|
|
HasDuration = true;
|
|
Duration = TimeSpan.FromSeconds(doubleSymbol.Value);
|
|
}
|
|
|
|
public bool HasDuration { get; }
|
|
|
|
public TimeSpan Duration { get; }
|
|
} |