I’m using a game engine that cannot serialize nested lists such as List<List<int>>. What I need is a quick solution that will store multiple lists into one list. I am about to write this on my own but am wondering if any solutions already exist.
Are there any wrappers out there that can store ‘virtual’ nested lists into one big list while providing the functionality you would expect from separate lists?
You can use
Enumerable.SelectManyto flatten nested lists:You could use a
Tuple<int, int>to store the number of the original list inItem1and the number itself inItem2.