I wasn't really sure how to address this question, so I will start with "pseudo" code:
List<Player> players = new List<Player>();
players.Add(p1);
players.Add(p2);
players.Add(p3);
while(true) //infinite loop
{
Player nextOne = players.Get(); // It will always get next player
}
I'm looking is a collection/list/buffer/array etc. that will have some kind of "Get" method, which return next item, always. And when it reach the end, it will return first item.
Great example would be a card game, like poker: I have list of players.. I always return next player, like in the circle.
My question is: is there already, somewhere in C#/.NET, such collection implemented?
If not, is writing an extension method for List
the best solution?