Exemplo n.º 1
0
        public ReelSegment GetSegmentFromOffset(int offset, ReelSegment fromReelPosition = null)
        {
            var currentIndex = IndexOf(fromReelPosition ?? CurrentPosition);
            var desiredIndex = MathHelper.CalculateOffsetPosition(currentIndex, offset, _segments.Count);

            return(_segments[desiredIndex]);
        }
Exemplo n.º 2
0
 protected virtual void OnPositionChanged(ReelSegment previousPosition, ReelSegment currentPosition)
 {
     PositionChanged?.Invoke(this, new ReelPositionChangedEventArgs
     {
         Current  = currentPosition,
         Previous = previousPosition,
         Reel     = this
     });
 }
Exemplo n.º 3
0
 public int IndexOf(ReelSegment reelSegment)
 {
     return(_segments.IndexOf(reelSegment));
 }