I have a class called Foo with a float and Bar property.
public class Bar
{
//Contains Stuff
}
public class Foo
{
public Foo(Bar _key, float _score)
{
Bar = _key;
Score = _score;
}
public Bar Key;
public float Score;
}
Bar[] barArray = new Bar[10];
List<Foo> fooList = barArray.ToList() //Where this would initialize the List with 10 Foo elements
// each with the respective Bar object from the array and
//a value of 0.0 for their Score;
I have an array of Bar objects. I want to create a List of Foo objects that have its "Key" properties initialized to the values in the array and its "Score" values initialized to 0.