Q: Converting array into Generic List format? I have come across some code that is exactly what I need for my program but it uses and array and I am unsure of how to convert it so it uses a generic list instead:
for (int i = 0; i < people.Length; i++)
{
     if (people[i].DoThisAction(action, numberOfActions))  //starts with the first one, if cannot moves onto next one
        return true;
}
return false;

I want to be able to get a single "person" object from the list and use it in the if statement.
For example: 
for (int i = 0; i < (amount of people in list); i++)
{
    if(people[indexnumberoflist].DoThisAction(action, numberofActions)) 
       return true; 
} 
return false;


A: It seems like what you may be looking for is actually a foreach loop. It would look something like this:
foreach (var person in people)
{
    if(person.DoThisAction(action, numberofActions))
       return true;
}
return false;

Which can be further reduced to:
return people.Any(person => person.DoThisAction(action, numberofActions));

Using a LINQ-expression if you wish.
