I'm new at C# so be easy on me please
I have a method which creates an elf, with a random age, strength (1-5) and speed.
For my main, I want to create a List of random elves, but I can not manage to do it
Lets say my elf class is:
class Elf
{
public int age;
public int strength;
public int speed;
Random rnd = new Random();
public void newElf()
{
this.age = rnd.Next(20, 50);
this.speed = rnd.Next(10, 20);
this.strength = rnd.Next(1, 5);
}
}
So, how can I manage to complete a List with, lets say, 5 different elves(in my code, I ask the user how many elves does he want to create)
List<Elf> e = new List<Elf>()
*Sorry for the bad English, it is not my first language
Thank you