using System.Collections.Generic;
public static void Main()
var weaponList = new ContinuousList<Weapon>();
weaponList.Add(new Sword());
weaponList.Add(new Axe());
Console.WriteLine(weaponList.Current);
Console.WriteLine(weaponList.Current);
Console.WriteLine(weaponList.Current);
public class Sword: Weapon{}
public class Axe: Weapon{}
public class ContinuousList<T>
private List<T> internalList = new List<T>();
private int currentIndex = 0;
public void Add(T item) => internalList.Add(item);
public T Current {get => internalList[currentIndex];}
if(currentIndex >= internalList.Count) currentIndex = 0;
public void MovePrevious()
if(currentIndex <= 0) currentIndex = internalList.Count - 1;