public override PatternActionResult Invoke(long time, PatternContext context) { if (State != PatternActionState.Enabled) { return(PatternActionResult.DoNothing); } var anchorTimes = context.GetAnchorTimes(Anchor); var newTime = 0L; switch (AnchorPosition) { case AnchorPosition.First: newTime = anchorTimes.First(); break; case AnchorPosition.Last: newTime = anchorTimes.Last(); break; case AnchorPosition.Nth: newTime = anchorTimes[Index]; break; } return(new PatternActionResult(newTime)); }
public PatternActionResult Invoke(long time, PatternContext context) { var anchorTimes = context.GetAnchorTimes(Anchor); var newTime = 0L; switch (AnchorPosition) { case AnchorPosition.First: newTime = anchorTimes.First(); break; case AnchorPosition.Last: newTime = anchorTimes.Last(); break; case AnchorPosition.Nth: newTime = anchorTimes[Index]; break; } return(new PatternActionResult(newTime)); }