Array/List loop constructor suggestions?

What is the optimal way to make a list<T> from a collection of elements in different arrays?

string[] Races = { "Human", "Orc", "Elf" }; int[] Attack = new int[] { 1, 2, 3, 4, 5 }; int[] Defense = new int[] { 1, 2, 3, 4, 5 }; List<Enemy> NPCs = new List<Enemy>{}; 

E.G., I would have a new List of "Enemy" objects, where I could pull from for a random encounter generator: Human-1-1, Human-1-2,Human-1-3 … ending with: Elf-5-5

Is a for or while loop the best here? Thanks for the suggestions.

by blackcamo via /r/csharp

Leave a Reply