So this is what I have for my list.
[0], [1], [2], [3], [4]
I want to be able to loop through these – But the trick here is that I want to start at an offset then loop around back to that offset?
ex.
[0], [1], [2], [3], [4]
o-->
//Start at offset 1 then get 2, 3, 4 then loop back around to zero
ex2.
[0], [1], [2], [3], [4]
o-->
//Start at offset 3 then get 4, then loop back around to zero, then 1, 2
I thought about using the regular List<T> and trying to implement this concept into a for loop but I’m not sure if I want to do that if theirs a more concise way of doing so.
Basically don’t start at 0 and loop back to the start and go through the elements back to the offset.
You are really describing a ring buffer or circular buffer.
http://en.wikipedia.org/wiki/Circular_buffer
The simple implementation is