public ReelSegment GetSegmentFromOffset(int offset, ReelSegment fromReelPosition = null) { var currentIndex = IndexOf(fromReelPosition ?? CurrentPosition); var desiredIndex = MathHelper.CalculateOffsetPosition(currentIndex, offset, _segments.Count); return(_segments[desiredIndex]); }
protected virtual void OnPositionChanged(ReelSegment previousPosition, ReelSegment currentPosition) { PositionChanged?.Invoke(this, new ReelPositionChangedEventArgs { Current = currentPosition, Previous = previousPosition, Reel = this }); }
public int IndexOf(ReelSegment reelSegment) { return(_segments.IndexOf(reelSegment)); }